1. shutdown1.vbs ):
Set coloperatingsystems = GetObject ("winmgmts: {(shutdown)}"). execquery ("select * From win32_operatingsystem ")
For each objoperatingsystem in coloperatingsystems
Objoperatingsystem. win32shutdown (8)
Next
2. The delay is 60 seconds. If you are prompted before shutdown, you can cancel shutdown before the delay is reached (shutdown2.vbs script ):
Set wshshell = Createobject ("wscript. Shell ")
Timeout = 60
'Time out' can be customized
Ask = "the system will shut down in" & timeout & "seconds! "
Title = "automatic shutdown prompt"
Constants = vbexclamation + vbokcancel
Result = wshshell. Popup (ask, timeout, title, constants)
If result = vbcancel then
Elseif result = true then
Set coloperatingsystems = GetObject ("winmgmts: {(shutdown)}"). execquery ("select * From win32_operatingsystem ")
For each objoperatingsystem in coloperatingsystems
Objoperatingsystem. win32shutdown (8)
Next
End if