@echo off
echo Scheduling shutdown in 1.5 hours.
shutdown.exe /h /t 5400
As it turns out, you can't actually use /h with /t. (Although /s works fine with /t) My solution was to learn some VBScript and kill the problem with excessive firepower! All you need to do is type the following code into an editor and save it as a *.vbs file. (I called mine Hibernate.vbs) I placed it right on the desktop for quick access.
hours = 0.001 'Specify the # of hours to sleep here
seconds = hours * 60 * 60
ms = seconds * 1000
Set wshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo("Hibernate in " & seconds & " seconds")
WScript.Sleep(ms)
cancel = wshShell.Popup("Cancel Hibernate?", 10, "System Shutdown!", VbYesNo + VbExclamation)
If cancel = VbYes Then
WScript.Quit(0)
End If
wshShell.Run("shutdown.exe /h")
No comments:
Post a Comment