Quick Links

Key Takeaways

To shut down your Windows 10 PC using Command Prompt, open a Command Prompt Window, then type "shutdown /s" into the window and hit enter. Your PC will shut down in less than one minute. To restart your PC, run "shutdown /r" instead.

Using the Command Prompt to turn off your Windows 10 PC provides more options and flexibility than merely using the shutdown option from the Start menu or pressing the power button on your PC. Here's how it's done.

Shut Down Your PC Using the Command Prompt

Start by pressing the Windows + R keys to open the Run window. From there, type "cmd" in the box and then select the "OK" button.

Press Windows+R, type "cmd" in the Run box, then hit Enter.

This will open the Command Prompt. Here, type shutdown /s.

The shutdown command in Command Prompt.

Once you press Enter, a message will appear letting you know that Windows will shut down in less than a minute. You can select the "Close" button if you like, but this will not affect the shutdown process.

Sign out message

That's all there is to it. Within the minute, your PC will shut down. There's also a way of restarting your PC using the Command Prompt if that's what you prefer.

Restart Your PC Using the Command Prompt

This process for restarting your PC is nearly identical to shutting down your PC, except you'll use a slightly different command in the Command Prompt.

Open the Run window by pressing the Windows Key +R keys, type "cmd" in the box, and then select the "OK" button to open the Command Prompt.

Once in the Command Prompt, type the actual restart command:

shutdown /r

Press the Enter key to proceed. Your PC will now begin the restart process within the next minute.

The restart command in the Command Prompt.

How to Schedule a Restart or Shutdown Using a CMD Command

If you want to schedule either the restart command or the shutdown command, you only need to add an argument to the previous commands we showed you. Specifically, you need to add /t TIME to the end of the command, replacing TIME with the number of seconds you'd like to wait. Let's say we wanted to schedule a restart in 10 minutes. We'd run:

shutdown /r /t 600 

If we wanted 5 minutes, we'd enter 300 seconds, and so on. The exact same time argument works with the full shutdown command, too.

These are just some of the many different options for shutting down your Windows PC from the Command Prompt. To get a full list of shut down options available to you, type shutdown /? in the Command Prompt and then press Enter. A complete list of switches and respective descriptions will be displayed.

A complete list of the arguments the Shutdown command can take.

For the convenience of our readers, we've provided the complete list of the shutdown commands and descriptions provided by Microsoft below.

List of Command Prompt Shutdown Switches and Parameters

Switch and Parameter

Description

/?

Display help.

/i

Display the graphical user interface (GUI).

/l

Log off. This cannot be used with /m or /d options.

/s

Shutdown the computer.

/sg

Shutdown the computer. On the next boot, if Automatic Restart Sign-On is enabled, automatically sign in and lock the last interactive user. After sign in, restart any registered applications.

/r

Full shutdown and restart the computer.

/g

Full shutdown and restart the computer. After the system is rebooted, if Automatic Restart Sign-On is enabled, automatically sign in and lock the last interactive user. After sign in, restart any registered applications.

/a

Abort a system shutdown. This can only be used during the time-out period. Combine with /fw to clear any pending boots to the firmware.

/p

Turn off the local computer with no time-out or warning. It can be used with /d and /f options.

/h

Hibernate the local computer. It can be used with the /f option.

/hybrid

Performs a shutdown of the computer and prepares it for a fast startup. Must be used with /s option.

/fw

Combine with a shutdown option to cause the next boot to go to the firmware user interface.

/e

Document the reason for an unexpected shutdown of a computer.

/o

Go to the advanced boot options menu and restart the computer. Must be used with /r option.

/m \\computer

Specify the target computer

/t xxx

Set the time-out period before shutdown to xxx seconds. The valid range is 0-315360000 (10 years), with a default of 30. If the time-out period is greater than 0, the /f parameter is implied.

/c "comment"

Comment on the reason for the restart or shutdown. A maximum of 512 characters allowed.

/f

Force running applications to close without forewarning users. The /f parameter is implied when a value greater than 0 is specified for the /t parameter.

/d [p|u]xx:yy

Provide the reason for the restart or shutdown. p indicates that the restart or shutdown is planned. u indicates that the reason is user-defined. xx is the major reason number (positive integer less than 256). yy is the minor reason number (positive integer less than 65536).

Once your Windows computer is turned off, don't forget to turn it back on.