Turning off or rebooting XP involves a several-step process: click the Start menu, choose Shut Down, and then select Shut Down or Restart. If you want, however, you can exit or reboot much more quickly, by creating a shortcut that enables one-click shutdowns. You can also use the shortcut to customize the shutdown or reboot—for example, by displaying a specific message or automatically shutting down any programs that are running.
shutdown -r -t 01 -c "Rebooting your PC"
Double-clicking on that shortcut will reboot your PC after a one-second delay and display the message "Rebooting your PC." The shutdown command includes a variety of switches you can use to customize it. Table 1-3 lists all of them and describes their use.
I use this technique to create two shutdown shortcuts on my desktop—one for turning off my PC, and one for
rebooting. Here are the ones I use:
shutdown -s -t 03 -c "See you later!"
shutdown -r -t 03 -c "You can't get rid of me that quickly!"
switch What it does
-s Shuts down the PC.
-l Logs off the current user.
-t nn Indicates the duration of 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 Reboots the PC.
Another Example
1 Usage: %s [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args
Display this message -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
Shutdown comment (maximum of 127 characters) -c "comment"
Forces running applications to close without warning -f
-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 less than 256)
yy is the minor reason code (positive integer less than 65536)
2 Shutdown
3 Restart
4 Abort
5 Logoff
6 Standby
7 Disconnect
8 Failed to get privilage
9 Action not supported:
10 Getting computer names, please wait...
11 computers Listed
12 Listing completed(total:
13 Too many computers to list. Please use add button
14 System error occurred
15 Warning
16 Succeeded
17 Failed
18 No computers to act on. Click cancel if you want to exit
Saturday, August 27, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment