Page 1 of 1 1
Topic Options
#37427 - 2003-03-06 01:25 PM Using WILDCARD in registry field
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 Offline
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
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 Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#37431 - 2003-03-06 02:36 PM Re: Using WILDCARD in registry field
Radimus Moderator Offline
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

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#37432 - 2003-03-07 10:38 AM Re: Using WILDCARD in registry field
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
#37433 - 2003-03-07 03:45 PM Re: Using WILDCARD in registry field
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Check the @ERROR/@SERROR codes.
_________________________
There are two types of vessels, submarines and targets.

Top
#37434 - 2003-03-07 03:48 PM Re: Using WILDCARD in registry field
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
where do you set the value of $HKCUSMWNTCV?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#37435 - 2003-03-07 04:10 PM Re: Using WILDCARD in registry field
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
you can also wonder why this'd fail :

$Reg = $VERYLONGVARIABLESIMPLYUNDEFINED + '\SOMEKEY'

Think its time to think over providing registry related code that is as posted simply incomplete (at least in starters section) [Wink]
_________________________



Top
#37436 - 2003-03-11 01:37 PM Re: Using WILDCARD in registry field
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
#37437 - 2003-03-11 01:45 PM Re: Using WILDCARD in registry field
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ok,

do you have this line in your script ?



$HKCUSMWNTCV = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion"



If not it is no wonder that It fails

Hope this helps

Additionally :

to see what a variable contains :

code:
 
$var ? ;displays the value of the variable to the console and sets cursor in next line

get $ ;pause script execution until a key is pressed



[ 11. March 2003, 14:08: Message edited by: jpols ]
_________________________



Top
#37438 - 2003-03-11 02:28 PM Re: Using WILDCARD in registry field
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how you can view what variable has?

just place it in it's own place on your script, like:
"var has:" $var ?
_________________________
!

download KiXnet

Top
#37439 - 2003-03-11 03:11 PM Re: Using WILDCARD in registry field
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
#37440 - 2003-03-11 03:38 PM Re: Using WILDCARD in registry field
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't understand what you didn't understand but anyway.
the "?" in script is just console screen line-feed command.
_________________________
!

download KiXnet

Top
#37441 - 2003-03-11 03:46 PM Re: Using WILDCARD in registry field
Anonymous
Unregistered


I was actually replying to jpols
Top
#37442 - 2003-03-11 03:48 PM Re: Using WILDCARD in registry field
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, my correction goes there too.
show var on the screen and change cursor to next line.
so he was correct.

your line changes cursor to next line and then shows the var.
_________________________
!

download KiXnet

Top
#37443 - 2003-03-11 03:49 PM Re: Using WILDCARD in registry field
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Flexi,
Actually, there is little difference between the two.

$var ?
? $var

See the FAQ Topic: Is '?' a PRINT or NEWLINE command?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 857 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.063 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org