VBS implementation of REG.exe for use in GPOs
Written in 2010 for the Windows versions of the time. Check that the tool or steps still suit your environment before using them.
Usage: REG.vbs /Action:ADD|/Action:DELETE /Key:REGISTRYKEY [/Value:REGISTRYVALUE] [/DATA:REGISTRYVALUEDATA] [/TYPE:REGISTRYVALUETYPE]
Examples:REG.vbs /Action:ADD /Key:HKLM\Software\Test /Value:TestValue /Data:TestData /Type:REG_SZ
Download: Reg.zip
How to Use ItLink to this section
It adds or deletes registry keys and values on the local computer through WMI, which makes it usable as a GPO startup or logon script.
REG.vbs /Action:ADD|/Action:DELETE /Key:REGISTRYKEY [/Value:REGISTRYVALUE] [/DATA:REGISTRYVALUEDATA] [/TYPE:REGISTRYVALUETYPE]
cscript //nologo REG.vbs /Action:Add /Key:HKLM\SOFTWARE\NewKey
cscript //nologo REG.vbs /Action:Add /Key:HKLM\SOFTWARE\NewKey /Value:Setting /Data:1 /Type:REG_DWORD
cscript //nologo REG.vbs /Action:Delete /Key:HKLM\SOFTWARE\NewKey /Value:SettingParameter | Meaning |
|---|---|
/Action: | ADD or DELETE. |
/Key: | Full key path starting with HKCR, HKCU, HKLM, HKU or HKCC, or the long names such as HKEY_LOCAL_MACHINE. |
/Value: | Value name. Without it, ADD creates the key and DELETE removes the key. |
/Data: | Value data. For REG_BINARY and REG_MULTI_SZ, separate items with commas. REG_DWORD takes a decimal number. |
/Type: | REG_SZ, REG_EXPAND_SZ, REG_DWORD, REG_BINARY or REG_MULTI_SZ. |
The script prints nothing and errors are suppressed, so check the result in the registry.
Note: the hive prefix must be in upper case; hklm\... is not recognised. ADD with a value does not create the key first, so create the key in a separate line before setting values in it. If /Value: is given without /Data: or /Type:, ADD only creates the key.
No comments yet
Comments are moderated and appear once approved.