我自己的脚本如下:
dim strComputer
strComputer = "."
'wscript.echo "Rebooting "&strComputer
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next
可是WINDOWS 2003是没有反应的,我在cmd里面运行了一下shutdown -r -t 0报错如下:
The computer is processing another action and thus cannot be shut down. Wait until the computer has finished and then try again。
不知道大侠有没有解决办法呢?