const HKEY_LOCAL_MACHINE = &H80000002
'.= local computer or enter the name of the computer
strComputer = "."
'Creation of the Key
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv" )
strKeyPath = "SOFTWARE\Microsoft\Ma_Cle"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
'Creation of the Data
strValueName = "Example Expanded String Value"
strValue = "%PATHEXT%"
'Use this line to create an Expand String Value REG_EXPAND_SZ
oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'Use this line to create a String Value
' strValueNameR1 = "Load Balancer Name"
' strValueR1 = "lb1.dcs.amrcorp.com"
'oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueNameR1,strValueR1 ' strValueNameR8 = "Tracing Active"
' strValueR8 = 0
'Use this line to create a Dword Value
'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueNameR4,strValueR4
'More help on WMI Reg convertion on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/mapping_a_registry_data_type_to_a_wmi_data_type.asp |