Oreg.createkey Hkey_local_machine,strkeypath
Oreg.setexpandedstringvalue Hkey_local_machine,strkeypath,strvaluename,strvalue
Oreg.setstringvalue Hkey_local_machine,strkeypath,strvaluename,strvalue
Oreg.setdwordvalue Hkey_local_machine,strkeypath,strvaluename,dwvalue
Oreg.setbinaryvalue hkey_local_machine,strpath,strvaluename,ubinary
Oreg.setmultistringvalue hkey_local_machine,strkeypath,strvaluename,arrstringvalues
Oreg.deletekey HKEY_LOCAL_MACHINE, strKeyPath
Oreg.deletevalue Hkey_local_machine,strkeypath,strstringvaluename
Oreg.getexpandedstringvalue Hkey_local_machine,strkeypath,strvaluename,strvalue
Oreg.getdwordvalue Hkey_current_user,strkeypath,strvaluename,dwvalue
Oreg.getstringvalue Hkey_local_machine,strkeypath,strvaluename,strvalue
Oreg.getbinaryvalue hkey_local_machine,strkeypath,strvaluename,ubinary
Oreg.getmultistringvalue hkey_local_machine,strkeypath,strvaluename,arrstringvalues
'-------------------------------------------------------------------------------------------
Const HKEY_CLASSES_ROOT = &h80000000
Const HKEY_CURRENT_USER = &h80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &h80000003
Const hkey_current_config = &h80000005
' Create a registry key
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set StdOut = wscript.stdout
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "Software\system Admin scripting Guide"
Oreg.createkey Hkey_local_machine,strkeypath
' Create multiple string values
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "Software\system Admin scripting Guide"
strValueName = "Multi String Value Name"
Arrstringvalues = Array ("A-string", "second string", _
"Third string", "fourth string")
Oreg.setmultistringvalue hkey_local_machine,strkeypath,_
Strvaluename,arrstringvalues
' Create an extended string value
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "Software\system Admin scripting Guide"
strValueName = "Expanded String Value Name"
strvalue = "%pathext%"
Oreg.setexpandedstringvalue Hkey_local_machine,strkeypath,strvaluename,strvalue
' Create string and DWORD values
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set StdOut = wscript.stdout
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "Software\system Admin scripting Guide"
strValueName = "String Value Name"
strvalue = "String Value"
Oreg.setstringvalue Hkey_local_machine,strkeypath,strvaluename,strvalue
strValueName = "DWORD Value Name"
Dwvalue = 82
Oreg.setdwordvalue Hkey_local_machine,strkeypath,strvaluename,dwvalue
' Delete registry key
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "Software\system Admin scripting Guide"
Oreg.deletekey HKEY_LOCAL_MACHINE, strKeyPath
' Delete registry value
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "Software\system Admin scripting Guide"
Strdwordvaluename = "DWORD Value Name"
Strexpandedstringvaluename = "Expanded String Value Name"
Strmultistringvaluename = "Multi String Value Name"
Strstringvaluename = "String Value Name"
Oreg.deletevalue Hkey_local_machine,strkeypath,strdwordvaluename
Oreg.deletevalue Hkey_local_machine,strkeypath,strexpandedstringvaluename
Oreg.deletevalue Hkey_local_machine,strkeypath,strmultistringvaluename
Oreg.deletevalue Hkey_local_machine,strkeypath,strstringvaluename
' Enumerate registry values and types
' Enumerate subkeys
' List registry files
' Monitoring registry subkey events
' Monitoring registry subtree events
' Read binary registry values
Const HKEY_LOCAL_MACHINE = &H80000002
StrComputer = "."
Set StdOut = wscript.stdout
Set oreg=getobject ("winmgmts:{impersonationlevel=impersonate}!\\" &_
StrComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strValueName = "LicenseInfo"
Oreg.getbinaryvalue hkey_local_machine,strkeypath,_
Strvaluename,strvalue
For i = LBound (strvalue) to UBound (strvalue)
Stdout.writeline strvalue (i)
Next
Current 1/2 page
12 Next read the full text