Saturday 26 September 2009

How to restart/shutdown a PC remotely using command line

This question came about when I was on my test server trying to install some software remotely, on a client laptop. I wanted to apply some changes and needed to reboot so rather than rolling the two feet to my laptop I thought "hmmm, how can I do this from here". And here's the answer ...........

Open up a run window (Winkey + R)
Type 'cmd' to open a command prompt

Type :

shutdown m \\computername -s -t : 60 (This will shutdown the PC in question after 60 seconds).

shutdown m \\computername -r -t: 60 (This will restart the PC in question after 60 seconds).

shutdown m \\computername -r -t: 0 (This will shutdown the PC immediately).

shutdown m \\computername -a (This will abort the shutdown once it is counting down)

This code can also be added to a batch file to shutdown multiple PCs all at once !

No comments:

Post a Comment