你好我有一个小问题我想读出下面的reg_key
"hklm\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\自动更新\"
我用微软的例子试试这个:
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
最后更改了键路径“和”值名称,当我启动 vbs 时它什么也没显示。
这是我的代码
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
有人可以帮我或给我小费吗?
谢谢!
信息:操作系统 Win7 x64