Taking Control of System Properties, Startup, and Shutdown - 6.16 Creating a Reboot or Shutdown Shortcut
(Page 4 of 6 )
Problem
You want to reboot or shut down your PC quickly, and customize the way that it shuts down.
Solution
Using a graphical user interface
For a fast way to shut down or reboot your PC, create a shortcut on your desktop, and then double-click the shortcut.
To create the shortcut, right-click the desktop and select New -> Shortcut. The Create Shortcut wizard appears. On the first screen, for the location of the item, typeshutdown, followed by one of several switches, like this:
shutdown -r -t 01 -c "Rebooting your PC"
Click Next, and in the next screen, type in the name of the shortcut. This is what will appear on the shortcut on the desktop. Then click Finish. To shut down or reboot, double-click the shortcut.
The example above would create a shortcut that would reboot your PC after a one-second delay and display the message “Rebooting your PC.” You can instead tell the PC to reboot or you can have it log you off instead of shutting down. Table 6-3 lists the switches you can use withshutdown.
Table 6-3. Switches you can use with shutdown
| Switch | What it does |
| -s | Shuts down the PC |
| -l | Logs the current user off. |
| -t nn | Indicates the delay, in seconds, before performing the action. |
| -c“messagetext” | Displays a message in the System Shutdown window. A maximum of 127 characters can be used. The message must be enclosed in quotation marks. |
| -f | Forces any running applications to shut down. |
| -r | Restart the PC. |
Next: 6.17 Scheduling a Reboot >>
More Windows Scripting Articles
More By O'Reilly Media
|
This article is excerpted from chapter six of the Windows XP Cookbook, written by Robbie Allen and Preston Gralla (O'Reilly; ISBN: 0596007256). Check it out today at your favorite bookstore. Buy this book now.
|
|