Real Clear Computing

How to Use the Shutdown CMD Command in Windows (Shutdown, Restart, and Hibernate with CMD)

In this tutorial you will learn how to use the shutdown CMD command to shut down, restart, or hibernate your Windows computer.

Here are the command options you should be familiar with.

/pShuts down the computer immediately, with no time-out or warning
/sShuts down the computer after a warning
/rRestarts the computer after a warning
/tSets a delay before the shutdown or reboot. The delay is specified in seconds
/aAborts a scheduled shutdown or reboot
/hHibernates the computer
/lLogs out the current user

The /p option shuts down the computer immediately without warning.

shutdown /p

The /s option also shuts down the computer but provides a one-minute warning before proceeding.

shutdown /s

You can cancel a pending shutdown initiated with /s by running the shutdown /a command before the one-minute countdown expires.

shutdown /a

The /r option initiates a system reboot, similar to /s, with a one-minute warning before the computer restarts.

shutdown /r

The /t option schedules a shutdown or reboot after a specified number of seconds. Using /t 0 initiates an immediate action.

shutdown /s /t 60

Any scheduled shutdown or reboot initiated with the /t option can be canceled using the /a command.

shutdown /a

The /h option Hibernate the computer which means it saves the current state of your computer to your hard drive and then shutdown the computer. When you restart, it restores your computer to exactly as it was, so you can continue working where you left off.

shutdown /h

The last option is /l, which logs out the current user.

shutdown /l

Remember, you can only use the /t option to add a time delay when using the /s or /r commands. Any scheduled shutdown or reboot can be canceled by running shutdown /a.

The shutdown command is available in both the Command Prompt (CMD) and Windows PowerShell.