The fastest way to restart Windows from Command Prompt

You can restart your computer from Command Prompt using the shutdown command with the /r flag. The command is shutdown /s /t 0 to shut down when ready, or shutdown /r /t 0 to restart when ready. The /t 0 means zero seconds delay — if you want to give yourself time to save work, replace 0 with the number of seconds you want to wait (for example, /t 60 gives you one minute).

This method works on Windows 10, Windows 11, and earlier versions. You do not need administrator rights for the basic command, though some systems require elevated privileges depending on your user account settings. If you get an "access denied" message, right-click Command Prompt and select "Run as administrator" before typing the command.

Key Takeaways

  • Type shutdown /r /t 0 into Command Prompt and press Enter to restart your computer when ready.
  • Use shutdown /s /t 0 to shut down instead of restart, or change the 0 to a number of seconds if you need time to save files.
  • If you get an access denied error, close Command Prompt, right-click it, and select "Run as administrator" before trying again.
  • You can cancel a scheduled restart by typing shutdown /a before the timer runs out.

Opening Command Prompt on your computer

Press the Windows key and R together to open the Run dialog box. Type cmd and press Enter. This opens Command Prompt in standard mode. If you need administrator rights, press the Windows key, type cmd, right-click "Command Prompt" in the search results, and select "Run as administrator" instead.

On Windows 11, you can also right-click the Start button and select "Terminal (Admin)" to open a more advanced command window that works the same way. Either method gets you to a black window where you can type commands.

The shutdown command and its options

The shutdown command controls when and how your computer restarts or shuts down. The basic structure is shutdown /r /t [seconds]. The /r flag means restart; if you use /s instead, it shuts down without restarting. The /t flag sets the delay in seconds.

Common variations include shutdown /r /t 60 (restart after 60 seconds), shutdown /s /t 120 (shut down after 2 minutes), and shutdown /r /t 0 /c "Restarting for updates" (restart when ready and display a message on the screen). The /c flag lets you add a message that appears to other users on the network, though it is optional.

If you type the command and change your mind, you can cancel it by typing shutdown /a before the timer reaches zero. This works only if the restart or shutdown has not already begun.

What to do if the command does not work

If you type the command and nothing happens, the most common reason is that Command Prompt does not have the permissions it needs. Close the window, right-click Command Prompt in the Start menu, and select "Run as administrator." Then type the command again.

If you get an error message saying the command is not recognized, make sure you spelled it correctly — the most common mistake is typing restart instead of shutdown. Windows does not have a restart command; you must use shutdown with the /r flag.

On some corporate or school networks, the shutdown command may be blocked by group policy settings. If this happens, you will see a message saying the command is disabled. In that case, you will need to restart using the Start menu instead, or contact your IT department if you need command-line access.

Restarting with a delay so you can save your work

If you want to restart but need time to close programs and save files, use a delay. Type shutdown /r /t 300 to restart after 5 minutes, or shutdown /r /t 600 for 10 minutes. You can use any number of seconds you need.

When you run the command with a delay, Windows displays a notification in the system tray (the area at the bottom right of your screen) telling you when the restart will happen. You can cancel it at any time by typing shutdown /a in Command Prompt before the timer runs out. Once the timer starts, you cannot extend it — you have to cancel and start a new command if you need more time.

Restarting into Safe Mode or recovery options from Command Prompt

You can also use Command Prompt to restart into Safe Mode or Windows Recovery Environment. Type shutdown /r /t 0 /o to restart and open the advanced startup options menu. This gives you access to Safe Mode, System Restore, and other recovery tools without having to restart manually and press keys during startup.

This method is useful if your computer is having problems and you want to troubleshoot without restarting multiple times. The /o flag tells Windows to show the boot menu instead of starting normally.

Frequently Asked Questions

Can I schedule a restart for a specific time instead of a delay?

Command Prompt does not have a built-in option to restart at a specific clock time. You can only set a delay in seconds. If you need to restart at a particular time, use the Task Scheduler instead — search for "Task Scheduler" in the Start menu, create a new task, and set it to run the shutdown command at your chosen time.

What is the difference between /s and /r?

The /s flag shuts down your computer completely and turns off the power. The /r flag restarts it, which means it shuts down and then boots back up automatically. Use /r if you want the computer to come back on, and /s if you want it to stay off.

Will restarting from Command Prompt close my open files?

Yes. If you have unsaved work in any program, it will be lost when the restart happens. Always save your files before running the shutdown command, or use a delay (like /t 300) to give yourself time to close programs manually.

Can other people on my network see the restart message?

Only if you add the /c flag with a message. For example, shutdown /r /t 60 /c "Server maintenance" displays that message to other users connected to your computer. Without the /c flag, no message appears to anyone else.