Tips & Tricks: Restarting a Remote Windows Computer Using Command Prompt

Having moved all of our servers in to a cloud based environment we now face the challenge of restarting them remotely when they cease to respond via remote sessions. One easy way to do this is to control them via the command prompt.


Launch the command terminal via the run command 'Win+R' cmd and run the below command. Please note your user will need to have administrator right on the server you are running the commands for.


SHUTDOWN /r /f /t 0 /m \\<ServerName> /c "<Description>"
/s       Shutdown the computer.

/r       Shutdown and restart the computer.
/m \\computer Specify the target computer.

/t xxx   Set the time-out period before shutdown to xxx seconds.
         The valid range is 0-315360000 (10 years), with a default of 30.

         If the timeout period is greater than 0, the /f parameter is implied.
/c "comment" Comment on the reason for the restart or shutdown.
         Maximum of 512 characters allowed.
/f       Force running applications to close without forewarning users.

No comments:

Post a Comment