#37427 - 2003-03-06 01:25 PM
Using WILDCARD in registry field
|
Anonymous
Anonymous
Unregistered
|
I'm trying to insert a wildcard in a registry field i.e. HKLM\Microsoft\profiles\*\test
Can anyone suggest how to do it?2
|
|
Top
|
|
|
|
#37428 - 2003-03-06 01:48 PM
Re: Using WILDCARD in registry field
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Hi Flexi,
Think you may need to elaborate a bit. I'm figuring you want to enumerate all the keys under a certain key ? Check into the EnumKey function. It ...
quote:
Allows you to list the names of the subkeys contained in a registry key or subkey. Syntax: ENUMKEY ("subkey", index)
-Shawn
|
|
Top
|
|
|
|
#37429 - 2003-03-06 01:55 PM
Re: Using WILDCARD in registry field
|
Anonymous
Anonymous
Unregistered
|
No, as user profiles are uniquely named under a registry string.
I want to be able to wildcard that entry i.e. "Fred Bassett".
I think it should look something like this?
$X = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" + * + "\13dbbc0c8aa05101a9bb000aa002fc45a)"
|
|
Top
|
|
|
|
#37430 - 2003-03-06 01:59 PM
Re: Using WILDCARD in registry field
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You will have to perform this in two steps.
1. Enumkey on HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles
To get the items you do not know
Then 2. Substitute that value to build the complete key you want to read.
there are a couple UDFS that will return an array of the enumerated keys. then you can just use a for each loop. [ 06. March 2003, 14:00: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#37431 - 2003-03-06 02:36 PM
Re: Using WILDCARD in registry field
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
here is a snippet that may help...
code:
$MsgKey = "$HKCUSMWNTCV\Windows Messaging Subsystem\Profiles" $MProfile = ReadValue($MsgKey, "DefaultProfile") ;Read the current default profile IF $MProfile = "" ;If there is not default profile, create the profile using the PRF IF $MProfile = "" $MProfile = @userid endif
|
|
Top
|
|
|
|
#37432 - 2003-03-07 10:38 AM
Re: Using WILDCARD in registry field
|
Anonymous
Anonymous
Unregistered
|
The following scriopt is not updating the required field, how can I find out that the $MProfile is collecting the correct information?
Taking it that it has already, why won't the command work?
$MsgKey = "$HKCUSMWNTCV\Windows Messaging Subsystem\Profiles" $MProfile = ReadValue($MsgKey, "DefaultProfile") ;Read the current default profile
WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging
Subsystem\Profiles\$MProfile\13dbbc0c8aa05101a9bb000aa002fc45a","00036606","00620000","REG_BINARY")
Thanks in Advance
|
|
Top
|
|
|
|
#37434 - 2003-03-07 03:48 PM
Re: Using WILDCARD in registry field
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
where do you set the value of $HKCUSMWNTCV?
|
|
Top
|
|
|
|
#37436 - 2003-03-11 01:37 PM
Re: Using WILDCARD in registry field
|
Anonymous
Anonymous
Unregistered
|
If you're unable to answer the posting, I'd prefer it if you didn't.
I have retreived part of the text I required, but am unable to see how I can view what the variable is returning (my request).
PLEASE advise how I can view what a variable has collected.
|
|
Top
|
|
|
|
#37439 - 2003-03-11 03:11 PM
Re: Using WILDCARD in registry field
|
Anonymous
Anonymous
Unregistered
|
Thanks, sorry for the attitude!!
The display is actually ? $var, but I understood what you meant.
This has now allowed me to resolve the issue thanks for your help!!!
|
|
Top
|
|
|
|
#37441 - 2003-03-11 03:46 PM
Re: Using WILDCARD in registry field
|
Anonymous
Anonymous
Unregistered
|
I was actually replying to jpols
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 823 anonymous users online.
|
|
|