Computer and Software Support


Shutdown

This page is from Microsoft

Updated: January 21, 2005

Enables you to shut down or restart local or remote computers one at a time.
 
 
Syntax
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 you type, and all those following it will be ignored.
/l
Logs off the current user immediately, with no time-out period. You cannot use /l with /m \\ComputerName or /t.
/s
Shuts down the computer.
/r
Restarts the computer after shutdown.
/a
Cancels a shutdown, effective only during the time-out period. You may use a only with /m \\ComputerName.
/p
Turns off the local computer only (not a remote computer), with no time-out period or warning. You can use /p only with /d. If your computer does not support power off functionality, it will shut down when you use /p, but the power to the computer will remain on.
/h
Puts the local computer into hibernation, assuming that hibernation is enabled. You can use h only with /f.
/e
Enables you to document the reason for the unexpected shutdown on the target computer.
/f
Forces running applications to close without warning users in advance.CautionUsing the /f option might result in loss of unsaved data.
/m \\ComputerName
Specifies the target computer. Cannot be used with the /l option.
/tXXX
Sets the time-out period or delay before a restart or shutdown to XXX seconds, causing a warning to display on the local console. You can specify 0-600 seconds. If you omit /t, the time-out period defaults to 30 seconds.
/d [p:]XX:YY
Lists the reason for the system restart, shutdown, or power off. The following table describes the parameter values.ValueDescriptionp:Indicates that the restart or shutdown is planned. If you do not use the p: option, Shutdown Event Tracker assumes that the restart or shutdown is unplanned.XXSpecifies the major reason number (0-255).YYSpecifies the minor reason number (0-65535).
/c"Comment"
Enables you to comment in detail about the reason for the shutdown. You must first provide a reason using the /d option. You must enclose comments in quotation marks. You can use a maximum of 511 characters.
/?
Displays help, including a list of the major and minor reasons that are defined on your local computer, at the command prompt. Simply typing shutdown with no parameters also displays help.
Remarks
  • Users must be granted the Shut down the system user right to shut down either a local or remotely administered computer using the shutdown command. For more information, see "Access control overview" and "Privileges" in Related Topics.
  • Users must be members of the Administrators group to annotate an unexpected shutdown of either a local remotely administered computer. If the target computer is joined to a domain, members of the Domain Admins group might be able to perform this 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 call shutdown for each computer using a script, or you can use shutdown /i to display the remote shutdown dialog box.
  • If you specify a major and minor reason code, you must first define these reason codes on each computer for which you plan to use the particular reason. If the reason codes are not defined on the target computer, Shutdown Event Tracker cannot log the correct reason text.
  • Remember to indicate that a shutdown is planned by using the p: parameter. Omitting p: indicates that a shutdown is unplanned. If you type p: followed by the reason code for an unplanned shutdown, the command will not carry out the shutdown. Conversely, if you omit p: and type in the reason code for a planned shutdown, the command will not carry out the shutdown.
Examples
To force applications to close and restart the local computer after a one-minute delay with the reason Application: Maintenance (Planned) and the comment "Reconfiguring 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

Formatting legend

Format Meaning
Italic Information that the user must supply
Bold Elements that the user must type exactly as shown
Ellipsis (...) Parameter that can be repeated several times in a command line
Between brackets ([]) Optional items
Between braces ({}); choices separated by pipe (|). Example: {even|odd} Set of choices from which the user must choose only one
Courier font Code or program output