How to force restart a Windows box using VBScript?
- by tloach
I'm trying to find a way to force Windows to reboot, and I am running into issues. I've tried
Set OpSysSet = GetObject("winmgmts:{authenticationlevel=Pkt," _
& "(Shutdown)}").ExecQuery("select * from Win32_OperatingSystem where "_
& "Primary=true")
for each OpSys in OpSysSet
retVal = OpSys.Reboot()
next
I've also tried…