Re: Reading/Writing to Registry by Gino
Gino
Mon Oct 16 17:26:26 CDT 2006
Start by creating registry object to StdRegProv
============================
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
============================
Example to get everthing in the folder at
HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList
============================
Const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
============================
The contents of ProfileList is placed in the last parameter arrSubkeys
Hope this helps.
"Bad Beagle" <maxwelli@nospam.postalias> wrote in message
news:e6qzC4V8GHA.1492@TK2MSFTNGP02.phx.gbl...
> Can someone please point me in the right direction? I want to write a
> script that runs as a GPO startup script. If a certain reg key exists I
> want the script to exit but if the key does not exist I want to add the
> key and carry on with running the script. Thanks.
>