Shutdown
Enables you to shut down or restart a local or remote computer at once. Grammar
shutdown [ /I | / L | / S | / R | /A | / P | / H | / e] [/F] [/m//ComputerName] [/t XXX] [/d [P:]xx: YY/C"Comment"] Parameters
/I
Displays the Remote Shutdown dialog box. the/I option must be the first parameter typed, and all subsequent parameters will be ignored.
/ L
Immediately unregisters the current user without a time-out period. You cannot use/ l with /m//ComputerName or/ t .
/ S
Shut down the computer.
/ R
Restart the computer after you shut down the machine.
/A
Cancels the shutdown operation (valid only within the time-out period). The a parameter can only be used with /m//ComputerName.
/ P
Only the local computer (not the remote computer) is shut down, there are no hyper-times or warnings. / P can only be used with/ D . If your computer does not support power-down, using/ p will shut down the system without disconnecting your computer from power.
/ H
Leave the local computer in hibernation (if hibernation is enabled). Only h is used with/ f .
/ e
Allows an unexpected shutdown reason to be logged on the destination computer.
/ F
Forces the running application to close without warning the user in advance.
Warning
| • |
Using the/ f option may result in the loss of unsaved data. |
| • |
|
/ m //computername
Specifies the target computer. cannot be used with the/ l option.
/ T Xxx
Setting a restart or shutdown pre-timeout period or delay to XXX seconds causes a warning message to be displayed on the local console. You can specify a range of 0-600 seconds. If/ tis omitted, the default time-out period is 30 seconds.
/ D [P:] XX:YY
Lists the reasons why the system restarts, shuts down, or shuts down power. The following table describes the parameter values.
|
| Value |
Describe |
|
P: |
Indicates that a restart or shutdown is scheduled. If you do not use the p: option, the Shutdown Event Tracker assumes that no restart or shutdown is scheduled. |
|
Xx |
Specify the main reason code (0-255). |
|
Yy |
Specifies the secondary reason code (0-65535). |
/ C"Comment"
Allows you to make detailed comments about the shutdown reason. You must first use the/ d option to provide a reason. Comments must be quoted in quotation marks. You can use a maximum of 511 characters.
/?
Displays help at the command prompt, including a list of primary and secondary causes that are defined on the local computer. You can also display Help by typing only shutdown without any parameters. Notes
| • |
Users must be granted a user right to shut down the system before the user can use the shutdown command to shut down a computer that is managed locally or remotely. For more information, see "Access Control Overview" and "privileges" in Related topics. |
| • |
The user must be a member of the Administrators group to annotate an unexpected shutdown of a computer that is managed locally or remotely. If the target computer is joined to a domain, members of the domain Admins group may perform the procedure. For more information, see Default local groups and default groups. |
| • |
If you want to shut down more than one computer at a time, you can use a script for each computer to call shutdown, or you can use shutdown/i to display the Remote Shutdown dialog box. |
| • |
Once you have specified the primary and secondary reason codes, you must first define those reason codes for each computer that you plan to use for a specific reason. If the reason code is not defined on the target computer, Shutdown Event Tracker will not be able to log the correct reason text. |
| • |
Remember to use the p: parameter to indicate shutdown is a scheduled shutdown. Omit P: indicates shutdown is unplanned shutdown. If you type p:, followed by an unplanned shutdown reason code, the command will not perform shutdown. Conversely, if you omit p: and type a reason code for the scheduled shutdown, the command does not perform a shutdown. |
Example
To force the application to shut down and reopen the local computer after a one-minute delay, stating that the reason is "Application: maintenance (planned)", and that the comment content is "reconfigure Myapp.exe", type:
shutdown/r/t 60/c "reconfiguring myapp.exe"/f/d p:4:1
To restart the remote computer//servername with the same parameters, type:
shutdown/r/M//servername/t 60/c "reconfiguring myapp.exe"/f/d p:4:1 format Legend
|
| Format |
Significance |
|
Italic body |
Information that the user must provide |
|
Bold Body |
The user must type the element exactly as it appears |
|
Ellipsis (...) |
Parameters that can be repeated multiple times on the command line |
|
Between brackets ([]) |
Optional items |
|
Between curly braces ({}), separate the options with a pipeline (|). For example: {even|odd} |
Option group from which the user must select only one option |
|
Courier Font |
Code or program output |