Welcome to MSDN Blogs Sign in | Join | Help

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

 

Published Thursday, October 07, 2004 1:29 by Calvin_Hsia
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Reboot from remote desktop

Thursday, October 07, 2004 1:50 by Jakeypoo
How about Ctrl+Alt+End?

# re: Reboot from remote desktop

Thursday, October 07, 2004 1:51 by Wayne Kao
Or, when you're connected to the remote machine, from the command-line ("cmd"), just do:

- "shutdown" to shutdown
- "shutdown -r" to reboot
- "shutdown -i" to get a GUI
- "shutdown -l" to logoff

# re: Reboot from remote desktop

Thursday, October 07, 2004 2:10 by Scott Glasgow
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

# re: Reboot from remote desktop

Thursday, October 07, 2004 2:14 by Nicole Calinoiu
Or how about using the "Windows Security" item on the start menu?

# re: Reboot from remote desktop

Thursday, October 07, 2004 2:17 by Scott Glasgow
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.

# re: Reboot from remote desktop

Thursday, October 07, 2004 2:32 by ShadowChaser
I always thought you could use the Windows Security option to bring up the Ctrl-Alt-Delete menu and select shutdown from there.

# re: Reboot from remote desktop

Thursday, October 07, 2004 2:34 by Ben
Control-Alt-Delete.
In the task manager you can use the "Shut down" menu to either reboot or powerdown.

# re: Reboot from remote desktop

Monday, October 11, 2004 6:55 AM by Raj Kaimal

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

# re: Reboot from remote desktop

Sunday, June 19, 2005 2:32 by dean
thank you very much. I found this post via google. Was very after remotly flashing my dvd firmware!

# re: Reboot from remote desktop

Wednesday, June 29, 2005 12:59 by /usr/bin/Paul
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.

# re: Reboot from remote desktop

Wednesday, July 20, 2005 12:49 AM by who?
Ctrl + Alt + End worked! I'm saved!

# re: Reboot from remote desktop

Thursday, July 21, 2005 6:02 by mattchoo
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!

# re: Reboot from remote desktop

Saturday, August 13, 2005 3:40 by darkennis
on some systems (using RD) I have the option to shutdown from the windows Start button. does anyone know why this is not consistent?

# re: Reboot from remote desktop

Sunday, September 18, 2005 11:14 AM by Joe H
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...

# re: Reboot from remote desktop

Wednesday, November 02, 2005 8:38 AM by Matt
I would suggest using PSTools. It is freeware that can be found all over the net. You can remotely shutdown/restart machines, see how long a machine has been up and what hardware it has, list installed software, list running processes and kill them, and my favorite has been using a psexec \\hostname cmd , which get you into dos command line on the remote pc.

# re: Reboot from remote desktop

Thursday, December 01, 2005 9:44 AM by pgn
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

# re: Reboot from remote desktop

Tuesday, January 31, 2006 11:29 by dev
how to reboot a RD when its hang.

# re: Reboot from remote desktop

Saturday, March 04, 2006 8:45 by AB
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!

# re: Reboot from remote desktop

Wednesday, March 15, 2006 10:19 AM by Briggsy
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.

# re: Reboot from remote desktop

Wednesday, March 15, 2006 12:04 by Calvin_Hsia
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.

# re: Reboot from remote desktop

Wednesday, March 22, 2006 3:16 by BenLG
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...

# re: Reboot from remote desktop

Wednesday, April 12, 2006 12:03 AM by Randy@socgaming.net
click start click run type "control userpasswords2" from here you can select a user to auto log into the box on boot up.

# re: Reboot from remote desktop

Saturday, May 13, 2006 8:37 AM by Harry Spooner
Found this via google as well.
shutdown -r
worked great!  Thanks for the great info.

# If your machine freezes, maybe you can reboot it gracefully from another machine

Friday, June 09, 2006 12:26 AM by Calvin Hsia's WebLog
For some reason, one of my machines running Windows XP seemed to die while I was away at a meeting. I...

# re: Reboot from remote desktop

Wednesday, July 05, 2006 12:59 by Martin Duncan
Another googler :-)!

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

# re: Reboot from remote desktop

Thursday, July 06, 2006 5:58 by Krede
Anyone who knows how to force win 2003 server to load network drivers after rebooting?
Preferrably without having to make an automated user login?

# Analyzing Blog hit statistics

Thursday, July 20, 2006 12:52 by Calvin Hsia's WebLog
It takes a lot of work to create the blog posts and code samples that I put in my blog, and I was curious...

# re: Reboot from remote desktop

Monday, July 24, 2006 1:42 by Coupland
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

# re: Reboot from remote desktop

Tuesday, August 29, 2006 8:47 AM by Ajith
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.

# re: Reboot from remote desktop

Tuesday, August 29, 2006 3:57 by peter B.
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.

# re: Reboot from remote desktop

Tuesday, August 29, 2006 6:20 by ASHISH
Simple alt - f4 after closing all active windows

# re: Reboot from remote desktop

Sunday, November 19, 2006 3:08 AM by Yuval Ararat

You can connect to the console session on the server and then you will get the Start->Shutdown item instead of the disconnect.

use this in the command line:

mstsc /v:[your server] /console

this will save you tons of scripting.

# re: Reboot from remote desktop

Saturday, January 13, 2007 2:10 by Corey Goode

Yup...

Even connecting through Cisco VPN to my work network, RDP'ed into my desktop I can reboot using the "CTL-ALT-END" keys as stated by the tech above... easy sleazy way to reboot that sucker!

Corey

# re: Reboot from remote desktop

Friday, April 06, 2007 2:27 by Daan

Another googler here! This page has saved me a 1.5hour round trip to the office. Thanks!

Daan

# re: Reboot from remote desktop

Monday, May 14, 2007 7:54 AM by yoyo

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...

# re: Reboot from remote desktop

Friday, June 22, 2007 3:38 by Brian

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!

# re: Reboot from remote desktop

Thursday, August 02, 2007 2:51 by Rodge

Hey guys, I had a server that I had rebooted but after logging in, it was hung on a blue background, no icons, no taskbar and shutdown, windowskey + r, ctrl alt end all would not work, but I was able to rdp to another dc in the same lan and taskkill to stop lsass which rebooted the server, thanks!

# re: Reboot from remote desktop

Wednesday, August 29, 2007 1:37 AM by Ken

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

# re: Reboot from remote desktop

Wednesday, September 12, 2007 8:23 by Shan

On the remote machine click Start -> Settings -> Windows Security

# re: Reboot from remote desktop

Friday, September 14, 2007 11:23 AM by JM

I think if you do the Windows update for Remote Desktop it will add the shutdown option.

# re: Reboot from remote desktop

Wednesday, September 19, 2007 6:22 AM by All hung

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

# re: Reboot from remote desktop

Tuesday, September 25, 2007 8:24 AM by Matt

Yea, Ctrl-Alt-End does it for the remote machine.

# re: Reboot from remote desktop

Friday, September 28, 2007 1:09 AM by Mr_laughing_my_ass_off

I found it incredibly funny that the first few options involve mini-scripts and command line options. Then, out of nowhere, we get "Or how about using the "Windows Security" item on the start menu?"

Classic.

# re: Reboot from remote desktop

Monday, October 29, 2007 7:34 by Anty

shutdown -r worked perfectly, but I need to wait for 30 sec, which is negligible.

# re: Reboot from remote desktop

Thursday, November 01, 2007 6:46 by Bob

use -t 00 in the command line...

# re: Reboot from remote desktop

Friday, November 09, 2007 6:47 AM by Ancient

To access a computer after a  restart, Windows service "Terminal Services" must be set to automatic startup.

This solves the issue neatly :)

# re: Reboot from remote desktop

Saturday, December 22, 2007 2:25 by Googler

Another Googler saved a 2 hr round trip to the office on the weekend.

Thanks

# re: Reboot from remote desktop

Thursday, March 27, 2008 3:08 AM by Me

Google and Calvin Hsia saved me too!

# re: Reboot from remote desktop

Tuesday, April 01, 2008 6:05 AM by Abu

can add much more except Thanks.

Shut down re-started machines in Aberdeen and Bangkok.

Ta.

# shutdown windows from the desktop

Saturday, May 03, 2008 2:31 AM by shutdown windows from the desktop

# re: Reboot from remote desktop

Monday, May 05, 2008 10:48 by Scott W.

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?)

# re: Reboot from remote desktop

Sunday, June 08, 2008 8:46 by Lloyd

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.

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker