Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to list all the string value paths in the registry run key

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
Hello all, I am having troubles getting this to work. I need to list all the registry hey values and paths in the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key. I need to loop through the key, get all the value names and the paths. I cannot for the life of me to get this to work. Here is what I have:
Code:
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE 
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
    strComputer & "\root\default:StdRegProv")
 
strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 
strValueName = "SoundMAXPnP"
oReg.GetStringValue HKLM,strKeyPath,strValueName,strValue
WScript.Echo strValue 
'Next

I get an error Type Mismatch here
Code:
WScript.Echo strValue

Can some one show me some code that will do this loop?

Thanks for the help,
timgerr

-How important does a person have to be before they are considered assassinated instead of just murdered?
Congratulations!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top