And as you’ve seen, when you use Remote Desktop to get to your machine, the “Turn Off Computer” item is missing from the Start menu. To be honest, I’m not really sure why Microsoft chose to do that, it is inconvenient.
But we have ways.
Become a Patron of Ask Leo! and go ad-free!
I previously recommended using a copy of psshutdown from the folks over at Sysinternals.com. This is a command line tool that will allow you to shut down or restart a computer remotely. It actually has several options to control how quickly, whether to force running applications to close, and so on. It’s quite handy for batchfiles and to create shortcuts for shutting down.
Another approach doesn’t involve downloading any additional software. As it turns out Task Manager already has what we need.
On the remote machine, right click on the clock, and select Task Manager. Task Manager has a Shutdown menu, which includes items to Turn Off and Restart. Those do the same thing as the missing Start Menu items.
Another way is to choose Windows Security from the Start menu. This will bring up a dialog box that has a Shut Down button that has the Log Off, Shutdown, Restart, Disconnect, and Standby options.
Good tip, Mark. Unfortunately the Windows Security menu item disappears if you customize and choose “classic start menus”. The good news, though, is that the task manager, which is what that really is, is also accessible if you right-click the date in the task bar, and choose “task manager”. It has the Shutdown menu with all the options you list.
Thanks!
Leo
Windows XP Professional has built in support for shutdown via the “shutdown” command. Here is the useage:
C:\shutdown /?
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c “comment”] [-d up:xx:yy]
no args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c “comment” Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer le
ss than 256) yy is the minor reason code (positive integer less than 65536)
But how does the remote computer authenticate you with this shutdown command?
NT/XP Cross-machine authentication is a confusing topic, to be sure. The bottom line is that the account you’re logged into on machine A must be recognized by machine B and have appropriate permissions to shut down machine B. Depending on how things are set up the accounts setup could be as simple as having the same account user/password on both machines. It could be as complicated as a full Windows NT Domain or Active Directory entry.
From:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/datacenter/rrcHowToShutdownRemotely.asp :
“To perform this procedure, you must have the user rights to force a shutdown from a remote system.”
Leo
Oh… and the sysinternals tool psshutdown allows you to specify a user & password, bypassing the cross machine account confusion altogether.
Leo
For XP users, why not just click on the Desktop and just click on Alt+F4, which should bring up the shutdown,restart, window.
excellent that last comment my friend.. well done it worked like a dream.
I have tried to run a task used “psshutdown” with -f -k -t and “windows xp shutdown command” with -f -s -t from Symantec Ghost console. However every time machine has restarted instead power shut. Any idea.
please send me the method to shutdown remote machine using vb.net code.
I lost the ability to shutdown my pc from the start menu. The red button beside logoff is missing and i have to logoff first then shutdown which is pointless …… help me out and if you can e-mail me the response….
PLEASE E-MAIL
** E-Mail: mike.cordeiro@symaptico.ca
Shutdown can be missing if you’re using remote desktop or terminal services, but I’ve not found a scenario where it disappears on its own. If the logoff button were also not visible that’d be a different scenario, but it sounds like you can logoff just fine.
Leo
I would point you at using WMI. This isn’t VB.net per se, but:
Set OpSysSet =
GetObject(“winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//machinename “).ExecQuery(“select * from Win32_OperatingSystem where Primary=true”)
for each OpSys in OpSysSet
OpSys.Reboot()
Next
Leo
Hi
when I call the script from vb program
Set OpSysSet =
GetObject(“winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//machinename “).ExecQuery(“select * from Win32_OperatingSystem where Primary=true”)
it give automation error
Can any 1 tell me the problem, I am using WinXP Pro
did you replace “machinename” with the name of the target machine? What version of VB?
Leo
Shutdown option is missing from shutdown menu when u say shutdown, I dont get shutdown option only i get is log off option pls give solution on it the os is Windows 2000
Have you tried psshutdown as described in the article these comments accompany? (http://ask-leo.com/archives/000003.html )
Also, fire up task manager, which has a shutdown menu.
Good luck!
Leo
…there’s also a builtin windowns command…
shutdown
it takes several options (force, reboot, timeouts etc)
shutdown /? gives help
If you have another windows box with either windows 2000 or windows XP on it then you can use the manage MMC to connect to this machine and shut it down that way.
First ‘Right Click on ‘My Computer’ and select ‘manage’ (or type compmgmt.msc into the run window)
Then Right Click on ‘Computer Managment(Local)’ and select ‘connect to another computer’.
Select your computer from the list and connect to it with an admin account.
When the screen refreshes, click on ‘Computer Management(Computer Name)’ (where computer name is the name of your remote computer) and select ‘properties.
Then select the advanced tab.
Then select the ‘startup and recovery’ button.
Then use the shutdown tool that is provided to log off, shut down, or reboot the computer.
Two very easy “tricks” to shutdown Windows XP Pro while using remote desktop (and it doesn’t need you to download a thing!).
1. Press CTRL-ALT-HOME. This will bring up the Windows Security dialog offering a nice “Shutdown…” button. Choose your shutdown flavor (Shutdown, Reboot, etc)
2. If that doesn’t work (sometimes 1. just brings up the taskmanager), use the command “shutdown” from the Run dialog or command prompt. It needs some parameters.
eg. I use “shutdown -s -t 01” to shutdown my Pc or “shutdown -r -t 01” to reboot it. To view shutdown’s parameters try “shutdown /?” from a command prompt.
Whoops, that key combo is CTRL-ALT-END. >.<
To shutdown make shortcut to:
shutdown -s -t 01
To reboot:
shutdown -r -t 01
You can use the Windows icons and place the shortcuts in the quickstart bar for a nice look.
hey who tell me …. when i want to go my house i remember that i was not shutdown my office computer and i have his IP or computername so plzz how can i shutdwon it with our remoly in the commant prompt
waxa aan ahay somali ee cidii somali ah haklan ka igala soo xidhiidhi helsinki@hotmail.com
1. Log in remotely via Remote Desktop.
2. Click somewhere on desktop (no on icon or taskbar).
3. Press ALT + F4
4. Procceed as you desire.
just install RealVNC and you can run the remote XP machine as if you actually had keyboard and mouse attached.. free and simple…
Nice and usefull artice, thanks
Now if there was a way to hook this shortcut to the machine’s power button … Unfortunately pressing power button displays a “there are users logged in …” confirmation dialog, which is quite useless on a headless machine.
OK, I have windows XP PRO and I have tried all the things in this thread to shut down my computer that I use. and it wont work. I make a .bat and a .cmd whitch are both window command exe’s
Plese simple tell me what to enter into one of these to shut down the system. and is there a way to make it so i dont have to specify a computer naem tht way anyone can use it from any of the users on the computer.
@echo off
shutdown -r -f
what i have in my .cmd file now
hey can somene plz plainly write a command that you can turn any computer off on the network in a .bat file
i want to turn my second computer off from my other one
thanx anyone
iwant to restart my pc remotely using ip address it was connected remotely but now loged off and now i am not able to connect my pc remotely. hot to restart remotely i know the ip address or remote pc.
thanks
if you can get onto the remote computer using RDP then you just need to press ALT+F4 and select the desired operation.
if doing it from command prompt type:
shutdown -s -m \\COMPUTER NAME OR IP -t 00
use -r or -l instead of -s to invoke reboot or log off.
How do I shut down a computer using only an IP? Keep in mind, this computer is not on a network with mine.
You can turn off any networked Windows 2000 and XP machine with the following command-line tool:
shutdown /m \\computername /s
If you want more info on this command-lind tool just type: shutdown /?
Not if the account you’re currently logged into doesn’t have administrative privileges on the machine you’re trying to reboot.
Why make it so hard? Log in via remote desktop, open Task manager (right-click the task bar) and choose restart from the Shutdown menu.
Leo is right. If you do not have administrative priviledge you cannot run the task manager and the shutdown command is denied. In this case I recommand the following freeware: http://grc.com/wizmo/wizmo.htm.
This freeware allows you to create a shortcut that can do almost any action on the pc.
Here is solution:
When you are in remote desktop, press:
ctrl+alt+END – classic ctrl+alt+del window appears.
Click on Shutdown….
Oh thats realy simple go to the command prompt type:
c:\tsshutdn \server:ip address or computer name \powerdown
if u need restart change \powerdown to \restart
Alt+F4 is a good one as it now seems that the Shutdown menu is not part of Task Manager anymore? I don’t see it on mine with XP SP2.
Dear Leo
Wonder how to you startup and shutdown pc using scheduled task manager.
Thanks and Reagrds
Ram
shutdown -i -> Add 127.0.0.1 done!
Alt-F4 and Ctrl-Alt-End work great but my coworker who has XP SP2 also does have the Shutdown menu in Task Manager and I don’t. Why?
Stangely, I just attempted a shutdown on my company’s email server (not on our domain) and it worked. It shouldn’t without the right admin permissions, but it did. So give it a try if you ever need it.
I find Shutdown.exe to be pretty useful. I perform a net use \\\ipc$ /u: and then can run shutdown.exe -f -r -m \\ and in about 30-60 seconds I can tell it’s rebooting by using a ping -t in another command window. When the Request Time Out quit and it starts responding that’s a nice clue that the OS is booting back up again.
Start > Run > “shutdown”
“shutdown -r” if you want a restart.
Don’t include the “”
Hi,
I really don’t know where the Remote Desktop is gone, i don’t see it anymore in any of my accounts. I’ve looked everywhere in Program Files logged in as an admin and nothing, i really don’t know where is gone. How can i find it again????
The task manager will not have the “Shut Down” dialog if you are not using the welcome screen. This option is changed in the Control Panel under User Accounts and “Change the way users log on or off”. You don’t have to enable the memory hungry annoying welcome screen if you want to shut down remotely though, and a lot of company computer won’t have this option because they are logging onto a domain. To shut down when you do not have the welcome screen enabled, simply press ctrl+alt+end in the Remote Desktop session. This will bring up the same dialog as the “Windows Security” option in the start menu, and from here you can shut down or restart your machine. To disable this option for remote users use the group policy editor.
We run in a domain enviroment. I found it easy to download psshutdown from sysinternals.com but you could also create a batch file on the desktop that executes shutdown -r. I add -t 10 to shorten the wait. The downside it that you must have admin privledges to execute either method.
There is an utility named process explorer in http://www.sysinternals.com. this allows you to replace the task manager with a more powerful utility and at the same time you will have what you need. When the app. is running minimized with te right button of your mouse you’ll see the shutdown menu. It works I have it on all my machines.
There is also a way to call the shutdown / logoff / restart dilog box programmatically: copy and paste the following code into a .vbs or .vbe file and run it:
‘beginning of code
‘allows one to remotely bring up the shutdown dialogbox in Windows
Set WshShell = WScript.CREATEOBJECT(“shell.application”)
WshShell.ShutdownWindows()
HI
You can use ALT F4 to shut down your head less machine if you are using them remotly. and can use the command shutdown -a machnename