Hello i have got a little problem i want to read out the followin reg_key
"hklm\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\"
I try this with the example from microsoft:
const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set StdOut = WScript.StdOut Set oReg=GetObject( _ "winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "SYSTEM\CurrentControlSet\Control\CrashControl" strValueName = "AutoReboot" oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue WScript.Echo "SYSTEM\CurrentControlSet\Control\" _ & "CrashControl\AutoReboot" _ & " = " & dwValue
Finally changed the keypath "and" value name, when i start the vbs it shown nothing.
Here is my code
const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set StdOut = WScript.StdOut Set oReg=GetObject( _ "winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\" strValueName = "AUOptions" oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue WScript.Echo "AUOptions: " &dwValue
can someone help me or give me a tip please ?
Thanks!
Info: OS Win7 x64
rc = oReg.GetDWORDValue(HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue)
). What is the value of the variablerc
after running that statement? – Ansgar Wiechers