Reboot Windows computer from command line (CMD)

by admin on April 21, 2009

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.

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

To force applications to close 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"

The above commands for system reboot work on all Windows releases – Windows 7, Windows 8, Windows XP, Vista, Windows server 2003 and 2008.

Reboot Windows using WMIC commands:

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

wmic os where Primary='TRUE' reboot

Related Posts:
Reboot a remote computer

{ 3 comments… read them below or add one }

Binay January 13, 2012 at 3:15 pm

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’

Reply

admin August 12, 2013 at 12:49 pm

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

James July 30, 2013 at 2:47 pm

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?

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: