How to Shutdown or Restart Your Windows PC from CMD

See how you can use the shutdown command in a Command Prompt CMD to shut down or restart your computer.

In this post, I show you how to shutdown and reboot a Windows PC using the shutdown command from a CMD command line. It is good to know several ways to turn off your computer, beyond the conventional way, in case Windows crashes and you cannot turn off as normal.

We have received a complaint from many users that they cannot turn off their computers using the power button. The start menu may have stopped working in Windows 10, preventing access to the power button. In those scenarios, most people don’t know how to turn off their computers.

Shutdown Windows PC from CMD

If Windows 10/11 crashes, does not respond or freezes, preventing to shut down your computer, don’t despair. You can still make use a Command Prompt CMD window to shutdown PC, following these steps:

1. Use the keyboard shortcut Windows + R to open the Run window, type CMD and hit Enter key.

Open the Command Prompt CMD

2. In the opened Command Prompt window, type the command shutdown /s.

Shutdown PC from CMD

3. Then, hit Enter to shutdown PC.

If your change your mind, type shutdown /a and press Enter before the timeout to cancel the shutdown,.

Restart Windows from CMD

You can also reboot your Windows PC from the CMD. Follow these steps:

1. Run the Command Prompt searching for it in the Start menu.

2. Type the command shutdown /r.

Restart PC from CMD

3. Then, hit Enter to reboot the computer.

If you just want to log out of Windows, type shutdown /l and press Enter.

What the shutdown command can do

If in addition to shutting down and restarting your computer, you want to know what else you can do with this command, in the Command Prompt window, type shutdown and press Enter to see the different options:

  • Shutdown /s is used to shut down the computer.
  • To reboot, use shutdown /r.
  • Type shutdown /l to log out of Windows.
  • Shutdown /a is used to cancel or abort the shutdown process before the timeout ends.
Shutdown command from CMD

When using one of these commands to shut down, restart, or log out of the PC, Windows will show a message that the system will shut down in less than 1 minute. So you can use the abort command to cancel the system shutdown.

Scroll to Top