Click here to Skip to main content
15,885,757 members
Articles / General
Tip/Trick

Restarting a system remotely

Rate me:
Please Sign up or sign in to vote.
4.21/5 (12 votes)
24 Jan 2011CPOL1 min read 26.8K   7   12
Restarting a system remotely
I was using terminal services to connect to a machine remotely and for some strange reason, after a few minutes I got disconnected and was unable to connect to it (using the Microsoft Terminal Console). I could, however, ping it - and that made me feel quite irritated - I was stuck.

I knew restarting the remote system would fix this problem - but how?

So first, I went on to the internet and rummaged about a bit. Then, I went into the command prompt by typing in cmd (within the run command option in Windows) and typed in - shutdown -r -m \\xxx.xx.xx.xxx (xxx.xx.xx.xxx being my IP). I got a message that said something like "restart with force option". So I changed my restart command to shutdown -r -f -m \\xxx.xx.xx.xxx and lo, things worked. Within a few minutes my remote machine had restarted and I could remotely connect to it.

For other shutdown command options, type shutdown /? from within the command prompt and it should throw up a list of options.

I thought I would post this as a quick trick - it might help someone in a similar position sometime.

Cheers...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India

Comments and Discussions

 
GeneralRe: Thanks for the information. I never tried -a. Pin
Abhinav S24-Jan-11 19:16
Abhinav S24-Jan-11 19:16 
GeneralRe: Just tried it on Vista, you're right, it is optional now (us... Pin
Indivara24-Jan-11 19:03
professionalIndivara24-Jan-11 19:03 
GeneralReason for my vote of 4 nice man Pin
Pranay Rana24-Jan-11 20:37
professionalPranay Rana24-Jan-11 20:37 
GeneralRe: Thanks. Pin
Abhinav S24-Jan-11 20:48
Abhinav S24-Jan-11 20:48 
GeneralIndivara -t sets a timeout and AFAIK, is optional. Pin
Abhinav S24-Jan-11 17:32
Abhinav S24-Jan-11 17:32 
GeneralRe: Thanks for the information. I never tried -a. Pin
Abhinav S24-Jan-11 19:15
Abhinav S24-Jan-11 19:15 
GeneralDoesn't it require the -t option as well? like shutdown -s -... Pin
Indivara24-Jan-11 17:08
professionalIndivara24-Jan-11 17:08 
GeneralRe: Indivara -t sets a timeout and AFAIK, is optional. Pin
Abhinav S24-Jan-11 17:32
Abhinav S24-Jan-11 17:32 
GeneralReason for my vote of 4 You haven't mentioned anything about... Pin
DaveAuld24-Jan-11 5:54
professionalDaveAuld24-Jan-11 5:54 
GeneralRe: Dave - You are right. We must have administrative privileges... Pin
Abhinav S24-Jan-11 17:35
Abhinav S24-Jan-11 17:35 
GeneralGood tip Pin
Bill960314-Mar-10 13:09
Bill960314-Mar-10 13:09 
GeneralRe: Good tip Pin
Abhinav S14-Mar-10 18:29
Abhinav S14-Mar-10 18:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.