Create Shortcuts For Restart Shut Down Or Logoff On Windows XP and Vista

20

vista.jpgA few ways exist to restart, shutdown, or log off your Windows XP and Vista computer. The most popular methods used are the Start Menu or the famous Ctrl-Alt-Del.

Sometimes you may want to quickly click on a shortcut or create a keyboard shortcut that will accomplish the task. If so, here's a quick way to create those shortcuts to execute either restart, shutdown or hibernate.


Windows XP and Vista, include the built-in command shutdown.exe that will restart, shutdown and log off (Vista shutdown command includes the option to hibernate) your Computer. The shutdown command is also available for Windows 2000 and 2003 servers.

The basic options for shutdown.exe for both XP and Vista are:

  • -l Log off
  • -s Shutdown the computer
  • -r Shutdown and restart the computer
  • -t xx Set timeout for shutdown to xx seconds

On Vista (only) the hibernate option is

  • -h Hibernate the local computer.

To create a shortcut to shutdown your Computer, right click on the Desktop (or where you want to create a shortcut), and select New \ Shortcut. In the Type the location of the item text field enter:

%SystemRoot%\System32\shutdown.exe -s

NOTE: following screen shots are from Vista. Windows XP Create Shortcuts wizard will look a little different but the steps are the same. The %SystemRoot% is a System variable for C:\Windows folder.

shutdown1.png

Then click next to continue and give the shortcut a name and click Finish.

shutdown2.png

If you want to delay the time for restart, shutdown, log off, or hibernate (Vista only), you can use the -t switch to set a timeout delay for the command to execute. In the example above, adding timeout to the command for 10 seconds would look like this:

%SystemRoot%\System32\shutdown.exe -t 10 /s

If you prefer to use the the keyboard, you can easily add a keyboard shortcut to the new shortcut by following the steps outlined in the article Create Keyboard Shortcuts on Windows.

Comments on Create Shortcuts For Restart Shut Down Or Logoff On Windows XP and Vista Leave a Comment

November 6, 2007

sabarigiri @ 3:42 am #

dear team,
if possible plz send me how to create shortcut in windows 2000
send it to my mail

April 18, 2008

chris @ 1:32 am #

unfortunately, shutdown.exe does not work properly if you specify the options with a dash (-) as described in this article. you'll have to use the slash (/)

April 19, 2008
April 29, 2008

racybhavik @ 10:07 am #

Can there be something that can ask the user to cancel shutdown till the timeout period expires?

Thanks in advance:)

July 16, 2008

eoin @ 6:25 am #

This doesn't work unless you are logged in as an admin. Any workaround for this problem?

eoin @ 11:02 pm #

xp

July 17, 2008
July 22, 2008

eoin @ 12:31 am #

Ya I tried that, selecting an admin account, but it still does not shut down when clicking the shortcut icon (nothing happens, no message appears).

August 23, 2008

kayedanda @ 2:41 am #

what about a shortcut for the standby mode? can anyone teach me how to do that? thanks!

October 31, 2008

anon @ 1:08 am #

if you're using XP, restart the pc in safe mode. The administrator should appear in the welcome menu, and usually they're not password protected. Get in and change your account to an admin account. If you're using Vista, go to the root folder (usually C:\) windows\system32 and run cmd as administrator. Type in

net user administrator /active:yes

this will make the administrator appear in the welcome screen.

In vista it is possible to run the shortcut as administrator by right clicking the shortcut and choosing run as administrator.

Both the above will work only if the administrator account doesnt have password protection.

eoin @ 1:23 am #

But I don't want to change my account to admin!

anon @ 7:01 am #

:D … no idea how to do it then… you'll have to ask a geekier person… ;P

February 6, 2009

JLJacobs @ 11:53 pm #

Microsoft has a hotfix for this but it only will work on SP1. Most have already updated to SP3 so when you try to load the hotfiz you get an error msg that tell you it will not load because the update is older than the hotfix. So much for M$

— Jonn

March 18, 2009

That Person @ 4:56 pm #

Is it possible to enter a code that will keep it from logging off?

March 29, 2009

This Person @ 6:45 am #

http://www.addictivetips.com/windows-tips/prevent-log-off-and-shutdown-of-a-windows-xp-computer/

That link will help you. It says its for XP, but will work for vista as well

February 6, 2010

Eli Be @ 10:17 am #

Shutdown code:
C:\Windows\System32\shutdown.exe -s -t 00 -f

Restart/Reboot code:
C:\Windows\System32\shutdown.exe -r -t 00 -f

Log off code:
C:\Windows\System32\shutdown.exe -l -t 00 -f

u can change the 00 to a number of seconds you want for timeout, just in case u want to storp the opperation (wm_ …)

May 24, 2011

lol @ 7:44 am #

@eoin: the same problem for me.

lol @ 7:47 am #

@anon: the administrator is protected with password :( isn't there any other possibility for the shortcuts? because I'm just at one PC admin at our school but, I'm not network administrator so I can't change it at other PC's :( maybe you know any other possibility to be admin at all other PC's?

Leave a Comment

Fields marked by an asterisk (*) are required.

Subscribe without commenting