Most users probably don’t schedule their shutdowns; they either shut down immediately or leave the computer on. However, there are times when specifying a future shutdown is handy. For examples:
- You want to shut down your computer after allowing time for some process or download to complete first. Although many programs offer that option, most do not and if the process hangs, then the shutdown might never occur.
- You want to schedule the shutdown for bedtime without needing to interact with your computer.
- You want to ensure you don’t forget to turn off the computer, such as before leaving for vacation.
- You want the computer to shut down, even if you’re unexpectedly unable to do so manually.
And even if you don’t need a scheduled shutdown, the same Shutdown feature comes in handy in other ways:
- You need to shutdown via Command Prompt. I ran into this one recently after I booted into Safe Mode with the Alternate Shell. Without the normal GUI, I had to use the Shutdown command within the Command Prompt.
- You need to shutdown immediately. This same technique allows for quicker shutdown times than using the normal Windows menu.
- You want to create a shortcut for conveniently shutting down Windows.
Fortunately, all versions of Windows include the Shutdown feature, so you needn’t worry about compatibility.
Using the Shutdown Command
2. Enter shutdown -s -t #### in the Run dialog, where #### is the number of seconds to wait, and then click OK.
In this example, shutdown -s -t 3600 tells Windows to wait 3600 seconds (1 hour) before shutting down. To shutdown immediately, replace #### with 0. If you omit -t 0, the default of 20 seconds is used instead.
Some other codes you might find handy:
-l tells Windows to log you out.
-s tells Windows to shutdown; if you omit this and -r, you’ll be logged off instead.
-r tells Windows to restart your computer.
-t specifies the time delay before shutting down, measured in seconds.
-f forces any running applications to close without prompting.
-a aborts the shutdown command; this can only be used after triggering a scheduled shutdown.
-c “message” displays the quoted message in the shutdown window (there’s usually a warning before shutdown).
Some other examples:
shutdown -r -t 7200
(restarts after 2 hours)
shutdown -l -t 0
(logs off immediately)
(aborts the scheduled shutdown)
shutdown -s -f -t 86400 -c “Scheduled Shutdown”
(shuts down in 24 hours, forces all programs to close and displays the message “Scheduled Shutdown”)
The exact same codes work at the Command Prompt, so you can shut down even without the GUI. The codes also work in the Target field of shortcuts.