81,092
社区成员
发帖
与我相关
我的任务
分享
Const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strValueName = "DigitalProductId4"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Wscript.Echo "connect start....."
Set wbemServices = objLocator.ConnectServer(ip, "root\default", username, password)
Wscript.Echo "connect success."
set objinstance=wbemServices.get("stdregprov")
'set objmethod=objinstance.methods_("GetStringValue")
set objmethod=objinstance.methods_("GetBinaryValue")
objinstance.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
Wscript.Echo "The registry key does not exist."
Else
Wscript.Echo (strValue)
Wscript.Echo "The registry key exists."
End If