pc.jpg

STOP spending your hard earn money by having someone else fix your Computer. Do it yourself and save a bundle of cash.
Click for more info --> Windows PC Troubleshooting Unleashed!

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

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.

Filed under Windows Tips, Windows Vista Tips by

Comment

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

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

Watching The Net @ 6:27 am

@chris thanks for catching that mistake. I have updated the article with the correct syntax.

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

Watching The Net @ 11:25 am

@racybhavik

I don't know of anything that can prompt the user to cancel (other than writing code), but what you can do is open up a command prompt and type

shutdown /a

to abort shutdown. Or create a second shortcut using the above command. This way you can quickly click it instead of opening a command prompt.

July 16, 2008

eoin @ 6:25 am

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

Watching The Net @ 9:51 pm

@eoin

What Windows Operating System are you running?

eoin @ 11:02 pm

xp

July 17, 2008

Watching The Net @ 1:26 pm

@eoin

For what ever reason, you user account does not have the right to shutdown the system when executing the shutdown command (which is interesting since you can probably shut down from the Start menu).

Your best work around is to set run the shortcut with alternate credentials (admin account)when it is launched. To do this:

- right click on the shortcut (you created to shutdown, restart, etc)
- make sure the shortcut tab is selected and click on the Advanced button at the bottom
- check the box next to Run with different credentials and click OK back to the desktop.

After clicking on the shortcut, you will be able to select an account with admin rights and need to enter the password.

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

Leave a Comment

Subscribe without commenting