Windows Shutdown and Restart Shortcuts
~~Vic
Ferri, WinTips and Tricks
To create any of these
shortcuts, unless otherwise stated, right click your Desktop and choose
New>Shortcut and enter the appropriate command line for your system. Once
the command is entered, click Next and enter whatever name you want for the
shortcut. Then click Finish. If you want to change the icon, just right
click your shortcut, go to Properties and under the Shortcut tab, click
Change Icon.
You can also enter these commands in a bat file. To do that, simply enter
the command you want in a new text document and save it with a .bat
extension. You may want to add the echo off and clear sign commands to make
the bat file run without displaying the command lines being executed and to
make it close automatically. i.e.:
@echo off
RUNDLL32.EXE user,exitwindows
cls
Windows 95/98 only
Shutdown command
RUNDLL32.EXE user,exitwindows
Restart Command
C:\WINDOWS\RUNDLL.EXE user.exe,exitwindowsexec
Quick Restart Method
This will restart Windows (win.com) quickly without going through the entire
boot process - great for refreshing the registry after changes to it in
order to make them take effect. The typical way to do the same without a
shortcut is to click Start>Shutdown and hold down the shift key after
selecting Restart and clicking OK.
Note - before beginning this, make sure you are not hiding file extensions.
Open any Folder and click View>Folder Options> in Windows 95 or Tools>Folder
Options>View tab in Windows 98, and remove the checkmark from "Hide
extensions of known file types" if there. Once done, click Ok to save your
changes and proceed as follows:
Right click your desktop and choose New>Text Document.
Type this line only:
@EXIT
and save the document.
Now rename your text document with a BAT extension. i.e.: Restart.BAT
Move the bat file to your C: drive and then right click and drag it to your
desktop to create a shortcut to it.
Right click the new shortcut and under properties, click the Program tab
and put a checkmark next to "Close on Exit".
Under the Advanced tab put a checkmark next to "MSDOS Mode" and uncheck
"Warn Before Entering MSDOS mode". Click OK twice to save your changes and
close. You now have a desktop icon that when clicked will restart Windows
without rebooting.
Windows 98/Me only
Shutdown
rundll32.exe shell32.dll,SHExitWindowsEx 1
Restart
rundll32.exe shell32.dll,SHExitWindowsEx 2
Log Off only
rundll32.exe shell32.dll,SHExitWindowsEx 0
Force a shutdown
rundll32.exe shell32.dll,SHExitWindowsEx 4
The above will shutdown any running processes and shutdown your computer
without saving any data or warning. It should only be used if you have
problems shutting down normally.
Note the numbers at the end of each of the above command lines. They are
what make the different actions possible and they can be combined. The most
common combination is using the Force shutdown action with a restart.
Restart = 2 Force =4, so you would just add 6 to the end of the main
command line:
rundll32.exe shell32.dll,SHExitWindowsEx 6
If your computer supports the power-off feature, you
can also use the number 8 which is a Power Off action which
will not only shutdown your computer, but turn off the power
too.rundll32.exe shell32.dll,SHExitWindowsEx 8
To summarize:
0 = Logoff
1 = Shutdown
2 = Restart
4 = Forced Shutdown
8 = Power Off (Shutdown and turn off Power)
Another restart method is by using this command
in a shortcut:
RUNONCE.EXE -q
What the above will do is bring up the familiar Windows setup dialog box
with the progress bar indicating that Windows will restart in 15 seconds.
Windows 2000 and XP
Windows 2000 and XP come with their own shortcut utility, shutdown.exe but
it isn't the greatest as it does not do a complete shutdown of XP and
doesn't always work that great in 2000 either. It doesn't usually shutdown
your entire computer - it just shuts down Windows to the point of "It's Now
Safe To Turn Off Your Computer".
For both 2000 and XP, I recommend a better shutdown
utility developed by a Microsoft MVP - Andrej Budja -
which you can download from my
Wintips&Tricks File section if you are a member (and if not, you are
most welcome to join) I named it shutdown2.exe so that the original
shutdown.exe in 2000 and XP won't be overwritten. After downloading, place
it in your Windows\System32 folder.
Then, back at your desktop, use the following command lines for your
shortcuts.
Shutdown
shutdown2.exe -u -t 0
Restart
shutdown2.exe -r -t 0
Log Off
shutdown2.exe -I
Note the -t switch, this stands for TIME. -t 0 means the shutdown or reboot
action will begin immediately without delay after clicking your shortcut. If
you wanted to hold off the shutdown and restart for a certain length of
time, for whatever reason, then just indicate the number of seconds after
the -t. i.e. -t 30 would wait 30 seconds before shutting down or
restarting.
If you'd like to try the default shutdown utility shipped with XP and 2k,
click Start>Run and type
SHUTDOWN /?
This will show you all the options you can use with it.
You can also use this method to see all your options
for shutdown2.exe.Just type
SHUTDOWN2 /?
instead.
You can also create hibernate or standby shortcuts. For this, Windows own
shortcut utility works fine.
For standby use:
shutdown.exe -s
For hibernate use:
shutdown.exe -h
You can use the - t switch with the above as well. In fact , you can use
the -t with any of the shutdown actions. i.e.: shutdown.exe -s -t 45
would countdown 45 seconds before beginning standby.
You might also find it convenient to assign keyboard shortcuts to any of
your shutdown shortcuts. A handy one might be for the straight shutdown
shortcut. Assign it to Ctrl-Alt -S, for example.
To do this:
Right click the shutdown shortcut you created on your desktop and go to
Properties.
There you will see the Shortcut key box. Just type S in the box and it will
change to Ctr-Alt-S.
Click Ok to save your changes and you are done.
Another shutdown tool that ships with 2000 and XP is tsshutdn.exe that is
mostly used for shutting down servers. You can find out more about
this here, if you are interested:
http://support.microsoft.com/default.aspx?scid=kb;en-us;320188
<<<back to contents
Vic Ferri owns the very popular
WinTips and
Tricks and
Registry Answers. Subscribe to either and receive free Windows and Registry
Tips. He is also in charge of the
Printing Tips pages at Linda's Computer Stop. Vic has also created a program
which allows you to Lock & Hide desktop folders in Windows 9X/ME.
Read more and get the free demo here. And, he now offers a service to
convert PowerPoint presentations to .exe files which can be viewed on
computers which do not have PowerPoint installed.