我尝试连接的远程计算机如下:
这是我使用的代码:
Dim remotets, objComputer, colComputereremote, strComputer
Dim objSWbemLocator, objWMIServiceremote
strComputer = "XTEMB4"
WScript.Echo strComputer
'Get remote machine WMI service object
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIServiceremote = objSWbemLocator.ConnectServer(strComputer, "root\CIMV2", "dts", _
"dts", "MS_409", "ntlmdomain:" & "")
Set colComputereremote = objWMIServiceremote.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objComputer in colComputereremote
remotets = objComputer.LocalDateTime
WScript.Echo remotets
Next
WScript.Quit
我在Windows XP Embedded机器上尝试了相同的代码(与Win7机器相同的配置)并且工作正常。