How to Restart from Command Prompt in Windows 10, 11, and Server
Restarting or shutting down your Windows computer can be done quickly using Command Prompt or PowerShell. This method works on Windows 10, Windows 11, and Windows Server.
Restart Windows from CMD or PowerShell
To restart your computer, open Command Prompt or PowerShell and type:
shutdown -r
By default, Windows will show a one-minute warning before restarting. During this time, if you change your mind, you can cancel the restart by running:
shutdown -a
Set a Delay Before Restart
If you want to delay the restart, use the -t
option followed by the time in seconds. For example, this command will restart Windows after 300 seconds, which is 5 minutes:
shutdown -r -t 300
To restart immediately, set the time to 0
:
shutdown -r -t 0
Shut Down Instead of Restart
If you want to shut down your PC instead of restarting, use the -s
option:
shutdown -s
Examples
Restart Windows (1-minute default delay):
shutdown -r
Restart after 300 seconds (5 minutes):
shutdown -r -t 300
Restart immediately:
shutdown -r -t 0
Shut down instead of restart:
shutdown -s
Hibernate Windows:
shutdown -h
Log off the current user:
shutdown -l
Cancel a scheduled shutdown or restart:
shutdown -a
That’s all you need to quickly restart or shut down your Windows computer from the command line. This is a useful way to control your system, especially if the normal restart buttons aren’t responding.