Login | |
|
 |
RE: Read One Registry name/value from many subkeys. - 8/23/2007 6:11:35 AM
|
|
 |
|
| |
Parabellum
Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
|
not tested.. but try soething like this.... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Rockliffe\MailSite\MailUsers\MANY USER NAMES" strValueName = "Personality" oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys For Each subkey In arrSubKeys oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "\" & subKey,strValueName,strValue wscript.echo strValue Next >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
< Message edited by Parabellum -- 8/23/2007 6:13:47 AM >
|
|
| |
|
|
|
 |
RE: Read One Registry name/value from many subkeys. - 8/25/2007 5:27:37 PM
|
|
 |
|
| |
sheepz
Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
|
Copied from Parabellum, heres something that works for me: const HKLM = &H80000002 strComputer = "." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" oReg.enumValues HKLM, strKeyPath, arrSubkeys 'enum thru the values within strKeyPath For Each strSubkey In arrSubkeys oReg.GetStringValue HKLM, strKeyPath, strSubKey If strSubkey <> "" Then 'check if empty MsgBox strSubkey End If Next MsgBox "complete" depending on what you're trying to read, is it a Reg key(s) or Reg folder(s) within the registry. example from the repository: http://www.microsoft.com/technet/scriptcenter/scripts/os/registry/osrgvb10.mspx?mfr=true
< Message edited by sheepz -- 8/25/2007 5:30:32 PM >
|
|
| |
|
|
|
 |
RE: Read One Registry name/value from many subkeys. - 8/27/2007 12:09:22 PM
|
|
 |
|
| |
dm_4ever
Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
Create a Sub/Function to help recurse through all sub folders...look at what you have and try to think of how you would accomplish that and put something together. Look at the Frequently Asked Stuff post and you'll see an example of recursing through files and folders...though not the same...it is an example of recursion. EnumKey will return an array of all sub keys under a particular key EnumValues...well you're using it These are pretty much all you need for what you have mentioned...just need to add "recursion"
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|