A scripting for rebooting system

strComputer = " . "
Set objWMIService = GetObject ( " winmgmts: " _
& " {impersonationLevel=impersonate,(Shutdown)}!\ " & strComputer & " ootcimv2 " )
Set colOperatingSystems = objWMIService.ExecQuery_
(
" Select*fromWin32_OperatingSystem " )
For Each objOperatingSystemincolOperatingSystems
ObjOperatingSystem.Reboot()
Next

你可能感兴趣的:(script)