The RegWrite method sets the registry key or value named by strName.
WshShell.RegWrite strName, anyValue, [strType]
The strName parameter must begin with one of following root key names.
Short | Long |
HKCU | HKEY_CURRENT_USER |
HKLM | HKEY_LOCAL_MACHINE |
HKCR | HKEY_CLASSES_ROOT |
HKEY_USERS | |
HKEY_CURRENT_CONFIG |
Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.RegWrite "HKCU\ScriptEngine\Value", "Some string value"
WshShell.RegWrite "HKCU\ScriptEngine\Key\", 1 "REG_DWORD"
WshShell.RegDelete method, WshShell.RegWrite method