Book now with code EOY2025
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true") for each OpSys in OpSysSet OpSys.Reboot() next
Can you post what you have so far? Might give us a better idea what the problem might be. Also, can I ask what the purpose/goal of the script is?
Sie wrote: Remove the shutdown option with a GPO and run it from a batch file instead which calls the cmd line and would accept the -a switch and IF statement.
Set objShell = CreateObject("Wscript.Shell") intMessage = Msgbox("Did you do X job already?", _ vbYesNo, "Job Monitor") If intMessage = vbNo Then objShell.Run("Aborting Shutdown should go here") Else Wscript.Quit End If
Use code EOY2025 to receive $250 off your 2025 certification boot camp!