Restart Your Computer when ready with a Command Prompt Command

You can restart your computer when ready by opening Command Prompt and typing a single command. The fastest way is to press Windows key + R, type cmd, and press Enter. Then type shutdown /r /t 0 and press Enter. Your computer will restart right away with no additional steps.

This method works on Windows 7, Windows 10, and Windows 11. It bypasses the normal shutdown menu and is useful when your mouse or keyboard is not responding, when you need to restart as part of a troubleshooting step, or when you want to automate restarts through a script.

Key Takeaways

  • The command shutdown /r /t 0 restarts your computer when ready without a countdown or dialog box.
  • Open Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter.
  • You can add a delay by changing the 0 to a number of seconds — for example, shutdown /r /t 60 waits one minute before restarting.
  • To cancel a restart that is already scheduled, type shutdown /a in Command Prompt before the countdown ends.

Opening Command Prompt on Your Windows Computer

The fastest way to open Command Prompt is to use the Run dialog. Press Windows key + R at the same time. A small box labeled "Run" will appear on your screen. Type cmd (lowercase or uppercase both work) and press Enter. Command Prompt will open as a black window with white text.

If the Run dialog does not appear, your keyboard may not be responding. In that case, click the Windows Start button in the bottom left corner, type cmd in the search box, and click "Command Prompt" when it appears in the results.

You can also right-click the Windows Start button and select "Windows Terminal" or "Command Prompt" from the menu, depending on your Windows version. Any of these methods will open the command line interface you need.

The Shutdown Command and What Each Part Does

The command shutdown /r /t 0 has three parts. shutdown is the base command that tells Windows to shut down or restart. The /r flag means "restart" instead of just shutting down. The /t 0 part sets the time delay to zero seconds, so the restart happens when ready.

If you want to give yourself time to save work before the restart, change the 0 to a different number. For example, shutdown /r /t 120 will restart your computer in two minutes. Windows will display a notification on your screen counting down the time remaining.

You can also add a message that appears to other users on your computer. Type shutdown /r /t 60 /c "Your message here" to include text in the shutdown notification. This is useful if multiple people use the same computer and you want to warn them before the restart happens.

Canceling a Restart Before It Happens

If you typed a shutdown command with a delay and now want to stop it, you can cancel the restart. Open Command Prompt again and type shutdown /a. This command will cancel any pending shutdown or restart that has not yet started.

The cancellation only works if the countdown has not finished. Once your computer begins restarting, you cannot stop it from Command Prompt. If you see the restart notification on your screen, you have time to cancel — just open Command Prompt and run the /a command before the timer reaches zero.

Restarting in Safe Mode from Command Prompt

You can also use Command Prompt to restart your computer directly into Safe Mode, which loads Windows with only the most basic drivers and programs. Type shutdown /r /t 0 /o to restart and open the Advanced Startup Options menu. From there you can select Safe Mode or other diagnostic startup modes.

Safe Mode is useful when you are troubleshooting problems caused by recently installed software or drivers. Your computer will restart, show you the Advanced Startup menu, and let you choose which mode to boot into. This is safer than restarting normally and then trying to access Safe Mode through settings.

When to Use Command Prompt Restart Instead of the Normal Method

The Command Prompt restart is faster than using the Start menu when you know exactly what you want to do. It is also the only method that works if your graphical interface is frozen or not responding. If your mouse clicks are not registering or your screen is stuck, you can still use the keyboard to open Command Prompt and restart.

System administrators and IT professionals use Command Prompt restart commands in batch files and scripts to automate restarts across multiple computers or to restart a computer at a scheduled time. If you are setting up a script or automation task, the shutdown command is the standard way to control restarts from the command line.

For everyday use, the normal restart through the Start menu is fine. Use Command Prompt when your computer is not responding normally, when you need to restart when ready without any delay, or when you are following troubleshooting steps that specifically ask you to use the command line.

Frequently Asked Questions

What is the difference between shutdown /r and shutdown /s?

The /r flag restarts your computer — it shuts down and then boots back up. The /s flag only shuts down without restarting. Use /r when you want your computer to turn back on, and /s when you want it to stay off.

Can I restart my computer on a schedule using Command Prompt?

Yes, you can use the Windows Task Scheduler to run a shutdown command at a specific time each day or week. Open Task Scheduler, create a new task, and set it to run the command shutdown /r /t 0 at your chosen time. This is how many offices automate nightly restarts.

Will restarting with Command Prompt damage my files or programs?

No, restarting is safe. However, if you have unsaved work in open programs, that work will be lost. Save your files before running the restart command. Windows will close all programs during the restart process, just as it does with a normal restart.

What if I type the command wrong?

Command Prompt will show an error message if the command is not recognized. You can then type the correct command. The most common mistake is forgetting the forward slash before the flags — it must be shutdown /r /t 0, not shutdown r t 0.