≡ Menu

Reboot Windows computer from command line (CMD)

We can reboot a Windows computer from command line using the in-built shutdown command.  Below you can find syntax of this command for various use cases. The below commands work on Windows 7, Windows 8, Windows 10 and all other server editions.

Command to reboot windows computer

shutdown /r

The above command will set a time out of 30 seconds to close the applications. After 30 seconds, windows reboot will start.

If you want to reboot Windows with your own time out value you can use the below command.

shutdown /r /t timeout_in_seconds

To shutdown a Windows computer

shutdown /s

To abort computer reboot

If you have issued a reboot command and have changed mind, you can stop Windows reboot by running the below command.

shutdown /a

When you run this, you would see a pop up window at the right bottom part of the screen(near system tray) that shows the message “The scheduled shutdown has been cancelled”.

To force reboot by closing applications without warning

shutdown /r /f

Open the shutdown GUI

shutdown /i

Add reason for the reboot of the computer

shutdown /r /c "This is the reason for the reboot of the computer"

Reboot Windows using WMIC commands:

Reboot windows using WMIC

You can run the below wmic command to reboot Windows OS.

wmic os where Primary='TRUE' reboot

Related Posts:
Reboot a remote computer

17 comments… add one
  • Binay

    Is the abort command supposed to work if one has issued the reboot from GUI. I have tried this on my Windows 7 Ultimate, it does not seem to be working. it says ‘no shutdown was in progress’

    • admin

      Abort works only when you had issued the reboot/shutdown using the command. GUI actions are not aborted by /a option.

  • James

    I’ve just attempted all commands from Windows 7 Ultimate install disk (used as recovery disk) and I obviously have a fault with my disk trying to load the Windows installation volume, I’ve launched command prompt via shift F10 as the GUI was not responding or should I say it had a never ending hour glass, trying a force shut down resulted in ‘the function is unknown’ proceeded with some numerical digits inside of closed brackets?

  • Ramesh

    Shutdown /a is very handy when windows update tries to force reboot your computer. You can run this command and cancel the reboot if you don’t want the reboot to happen at that time.

  • Michael roy

    thanks

  • Srini

    Works for rebooting Windows 10 from cmd.

  • oldcomputerguy

    Very useful – works from remote desktop via command prompt.

  • Erick

    its Worked fine. this is awesome.

  • Stefan

    Restarting terminal is rebooting by other words?

  • Ornab

    Not working!!!

  • Edwin Leung

    How to Restart USB port?

  • Christopher White Sr.

    Thanks for sharing valuable information! Much appreciated

  • Jeff

    The great part of this command is that you can use it to restart Win 10 without installing MS Updates – won’t install updates if they are waiting like the GUI only allows you to…

  • Megh rana

    I am using Windows 10 + 7 .I hibernated it last night today when I opened it ,it asked me if I were to boot from scratch or continue with the boot process .I commanded it to continue and now it just shows the boot logo turns black and reboot

  • F1ckUp

    wmic os whre primary=”1″ reboot is just like wmic os where primary=”true” reboot btw

  • Peter Turner

    Those prompts dont work for me,all i get is :
    “is not recognized as an internal or external command,operable program or batch file”

    • Mike

      Same, doesn’t work ever. always says the command not recognized. Specifically it says- is not recognized as an internal or external command,operable program or batch file – . I have windows 11 and my 1 year old hp omen laptop is bricked!! Hate windows!

Cancel reply

Leave a Comment