Partager via


Reboot from remote desktop

Remote Desktop (mstsc.exe) is great: it allows me to access another remote machine as if I were sitting at its keyboard and seeing its screen.

My web server sits on top of a 7 foot tall bookcase but I have no need to touch it: I can use RD from other machines anywhere in the world.

It’s not obvious how to reboot the remote machine. The WinXP start menu Shut down option says “Disconnect” rather than “Shut down” and Ctrl-Alt-Del is intercepted by the local machine. (Windows Server 2003 has Disconnect as an option on the Shutdown menu.)

Here’s a simple way from within VFP (or similarly from VBScript or Jscript):

x=CREATEOBJECT("shell.application")

x.ShutdownWindows()

This brings up the Shutdown Windows dialog from which one can choose to Restart, Stand By, Shut Down, etc.

You can start RD simply from the VFP command window:

!/n mstsc

Or from the WinXP start menu:

Windows_Key+R mstsc

Comments

  • Anonymous
    October 07, 2004
    How about Ctrl+Alt+End?

  • Anonymous
    October 07, 2004
    The comment has been removed

  • Anonymous
    October 07, 2004
    Actually, to run shutdown from RD, you have to use the -f (force) switch to actually get the machine to shutdown or reboot.

    Something like....

    shutdown -r -f

  • Anonymous
    October 07, 2004
    Or how about using the "Windows Security" item on the start menu?

  • Anonymous
    October 07, 2004
    Hmm, ok, I guess you can just do a shutdown -r.

    I know I tried once before and it said I had to use the force option.

  • Anonymous
    October 07, 2004
    I always thought you could use the Windows Security option to bring up the Ctrl-Alt-Delete menu and select shutdown from there.

  • Anonymous
    October 07, 2004
    Control-Alt-Delete.
    In the task manager you can use the "Shut down" menu to either reboot or powerdown.

  • Anonymous
    October 10, 2004

    if you don't like the Windows Security option, how about iisreset /reboot?

  • Anonymous
    June 19, 2005
    thank you very much. I found this post via google. Was very after remotly flashing my dvd firmware!

  • Anonymous
    June 29, 2005
    I don't know what your all fussing about, the suggestion from Jakeypoo works perfectly. Just press Ctrl+Alt+End and it does the same as pressing Ctrl+Alt+Del on a normal system.

  • Anonymous
    July 19, 2005
    Ctrl + Alt + End worked! I'm saved!

  • Anonymous
    July 21, 2005
    ctrl-alt-end works great...but It's nice to know the alternatives. I was recently remote desktop'd into another remote desktop and ctrl-alt-end would bring up the first remote desktop windows security screen. shutdown -r was the obvious answer and i didn't think of it till reading here. thanks!

  • Anonymous
    August 13, 2005
    on some systems (using RD) I have the option to shutdown from the windows Start button. does anyone know why this is not consistent?

  • Anonymous
    September 18, 2005
    I was once able to reboot my XP file-share machine from the start menu, but have noticed that I lost that functionality. I presume this was in one of the Microsoft updates...

  • Anonymous
    November 02, 2005
    The comment has been removed

  • Anonymous
    December 01, 2005
    On WinXP, the "taskkill" command has been helpful when I've needed to shutdown an RD that's been 2 or 3 hops away from me (ie daisy-chained RD sessions) or a misbehaving RD session:

    From a CMD window (or create a .bat file with the following in it) type the following, then wait a couple of minutes for the machine to go down and come back up again.

    taskkill /f /im lsass.exe

  • Anonymous
    January 31, 2006
    how to reboot a RD when its hang.

  • Anonymous
    March 04, 2006
    Sweet! My machine at work was showing nothing but a black screen over RD ... Ctrl + Alt + End popped the task mgr, which forced a repaint or whatever, and I was back in business, skipping the 30 minute drive to and from the office to reboot!

  • Anonymous
    March 15, 2006
    This may be a stupid question, hopefully it is an easy answer. But i connect from a work PC to my home PC where remote desktop is setup. If i need to reboot the home PC for any reason, i used "windows security tab" worked fine and my home PC physically shutdown. When the PC restarts i cannot remote desktop connect onto it again because it is at the log in screen, and i don't think it has loaded the files needed to host a remote connection. I cannot remote connect untill i physically log in on that PC.

  • Anonymous
    March 15, 2006
    Briggsy: when a Windows XP machine is rebooted and nobody has logged in yet, a user can still remote desktop to the machine. I do this many times. One of my remote machines (web server) is on top of a 7 foot tall bookcase and I hardly touch it. When it gets reboot due to security updates, I can still RD to it with no problem.

  • Anonymous
    March 22, 2006
    Briggsy, I just called my girl friend to tel to log in because I had to reboot the machine and SP2 of XP does not load the netwoork interface until the user as logged in

    does anyone know the work arround ? Im running XP MCE...

  • Anonymous
    April 11, 2006
    The comment has been removed

  • Anonymous
    May 13, 2006
    Found this via google as well.
    shutdown -r
    worked great!  Thanks for the great info.

  • Anonymous
    June 08, 2006
    For some reason, one of my machines running Windows XP seemed to die while I was away at a meeting. I...

  • Anonymous
    July 05, 2006
    Another googler :-)!

    shutdown -i -l -r did the trick for me.  A very useful post.

  • Anonymous
    July 06, 2006
    Anyone who knows how to force win 2003 server to load network drivers after rebooting?
    Preferrably without having to make an automated user login?

  • Anonymous
    July 20, 2006
    It takes a lot of work to create the blog posts and code samples that I put in my blog, and I was curious...

  • Anonymous
    July 24, 2006
    shutdown -r works just fine without the -f switch

    but I always use shutdown -r -t 0 because I don't like waiting for the 30 second countdown

    another potentially useful command is CTRL+ALT+END... this will launch the Task Manager

  • Anonymous
    August 29, 2006
    Pressing Ctrl+Alt+End will not work when your TS session is deeper than one level. In such cases, invoke the On Screen Keyboard (Start > Run > osk) on the nearest TS session and click "Ctrl+Alt+End" keys using you mouse. It worked.

  • Anonymous
    August 29, 2006
    Does anyone know why a remote PC running Windows XP sp2 will reboot (or maybe it just logs itself off) after every session? even though I do a start, run, disconnect? every time I do that and try to access the PC again I have to log back into my AD account.

  • Anonymous
    August 29, 2006
    Simple alt - f4 after closing all active windows

  • Anonymous
    November 18, 2006
    The comment has been removed

  • Anonymous
    January 13, 2007
    The comment has been removed

  • Anonymous
    April 06, 2007
    Another googler here! This page has saved me a 1.5hour round trip to the office. Thanks! Daan

  • Anonymous
    May 13, 2007
    Ctrl+Alt+End works, BUT: Why not just R-click on the TaskBar and select Task Manager? This should probably also work for multiple levels of RD...

  • Anonymous
    June 22, 2007
    Ctrl-Alt-Delete will reboot the machine that you're sitting in front of.  Not what I wanted. Ctrl-Alt-End works to reboot a machine that you are connected to remotely.  Thanks guys!

  • Anonymous
    August 02, 2007
    The comment has been removed

  • Anonymous
    August 28, 2007
    I want to shutdown my PC. I use my home PC to check my e-mails but when I'm going home I want to shut it down. The problem is that the pc restarts don't know why... I tried "shutdown", "shutdown f", "Ctr + Alt + End", "Start -> Windows Security" and nothing... Always it restart. I'm using Windows XP MCE Sp2. Any idea? Thanks

  • Anonymous
    September 12, 2007
    On the remote machine click Start -> Settings -> Windows Security

  • Anonymous
    September 14, 2007
    I think if you do the Windows update for Remote Desktop it will add the shutdown option.

  • Anonymous
    September 18, 2007
    Does anyone how to force restart on a 2003 server that does not respond to shutdown -f -r -m\ servername or any other attempt to restart remotely? Or is hard switching the power all that´s left? Thanks

  • Anonymous
    September 25, 2007
    Yea, Ctrl-Alt-End does it for the remote machine.

  • Anonymous
    September 27, 2007
    The comment has been removed

  • Anonymous
    October 29, 2007
    shutdown -r worked perfectly, but I need to wait for 30 sec, which is negligible.

  • Anonymous
    November 01, 2007
    The comment has been removed

  • Anonymous
    November 08, 2007
    To access a computer after a  restart, Windows service "Terminal Services" must be set to automatic startup. This solves the issue neatly :)

  • Anonymous
    December 22, 2007
    Another Googler saved a 2 hr round trip to the office on the weekend. Thanks

  • Anonymous
    March 26, 2008
    Google and Calvin Hsia saved me too!

  • Anonymous
    March 31, 2008
    The comment has been removed

  • Anonymous
    May 02, 2008
    PingBack from http://kadin.newsmediacompany.com/shutdownwindowsfromthedesktop.html

  • Anonymous
    May 05, 2008
    Thanks for the great ideas!  On a similar note, is there a way to get an XP machine to reboot at a set time (ie, daily in the middle of the night?)

  • Anonymous
    June 08, 2008
    Scott W - I used to do this. I used to get my machine to shutdown each night at 1am. You can create a bat file that has shutdown commands in it and then set up a scheduled task to hit that bat file at whatever time/date you want.

  • Anonymous
    August 26, 2008
    I hope someone help with my RDP dilemma. When I reboot a windows 2003 SP2 server via remote desktop connection, sometimes I can't RDP after the server comes back up.  I physically have to go to the server rack, login to the server and restart it before I can make any RDP connection.  This has caused great pains when I reboot servers from my home. This is not just one server. All twenty servers do this sometimes. Some servers are in Admin TS mode and others are in application TS mode.

  • Anonymous
    September 24, 2008
    thanks for posting this, it helped me.

  • Anonymous
    October 24, 2008
    Very useful. I had no idea there were soooo many ways to shutdown

  • Anonymous
    December 09, 2008
    pgriffin: use [server] /console to correct that problem.

  • Anonymous
    March 10, 2009
    The comment has been removed

  • Anonymous
    April 17, 2009
    Similar to pgriffin's problem, after I reboot my remote XP SP3 machine, it won't let me RDP in as it seems the network drivers aren't loaded yet.  "Terminal Services" is set to automatic startup. I have to physically login to the machine before it will allow me to RDP. Is there a way to force the drivers to load on bootup so I can RDP in after a reboot?

  • Anonymous
    April 24, 2009
    The comment has been removed

  • Anonymous
    May 21, 2009
    LOL. Hilarious... Saved me tons of time this one

  • Anonymous
    May 30, 2009
    a 5-year-old thread that deserved to be the top hit for my search!

  • Anonymous
    June 08, 2009
    PingBack from http://toenailfungusite.info/story.php?id=3086

  • Anonymous
    June 16, 2009
    PingBack from http://workfromhomecareer.info/story.php?id=13124

  • Anonymous
    May 04, 2010
    I use alt+F4 to reboot the machine