How to restart Windows from the command line.

image 771929

This has become especially helpful for me since Windows Server 2012 (not R2) does not come with an easy option to do this. In fact I’ve become quicker doing it this way anyway so it’s a win-win.

Open up your handy dandy command prompt. This can be done in a few ways.

I usually need to run as Administrator so I’ve made a habit of hitting the Windows key on the computer to bring up the Start menu, typing CMD and then hitting Ctrl+Shift+Enter.

Otherwise, click Start, type CMD, right-click on it and click ‘Run As Administrator’.

(You can also hit Windows+R for the Run menu, then type in CMD but this won’t run as administrator by default.)

image 773661

Now type in shutdown.exe /r /t 0 and hit Enter. The /r switch means restart and the /t 0 means the time in seconds until it happens.

image 774187

Now I don’t think this can be done without the /t 0 and frankly I’m too lazy to test it right now but if you want some help on some of the other switches, here is the Microsoft article.

Other blog posts