Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

shutdown

Feedback

In this article

Enables you to shut down or restart local or remote computers, one at a time.

Syntax

shutdown [/i | /l | /s | /sg | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/soft] [/fw] [/f] [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

Parameters

ParameterDescription
/iDisplays theRemote Shutdown box. The/i option must be the first parameter following the command. If/i is specified, all other options are ignored.
/lSigns out the current user immediately with no time-out period. The/l parameter works independently and can't be combined with any other parameters. Attempts to combine/l with any other parameter is ignored.
/sShuts down the computer.
/sgShuts down the computer. On the next boot, ifAutomatic Restart Sign-On is enabled, the device automatically signs in and locks based on the last interactive user. After sign in, it restarts any registered applications.
/rRestarts the computer after shutdown.
/gFully shuts down and restarts the computer. On restart, ifAutomatic Restart Sign-On is enabled, the device automatically signs in and locks based on the last interactive user. After sign in, it restarts any registered applications.
/aAborts a system shutdown. Can only be used during the time-out period. Combine with/fw to clear any pending boots to firmware.
/pTurns off the local computer only (not a remote computer) with no time-out period or warning. You can use/p only with/d or/f. If your computer doesn't support power-off functionality, it shuts down when you use/p, but the power to the computer remains on.
/hPuts the local computer into hibernation, if hibernation is enabled. The/f switch can be used with the/h switch.
/hybridShuts down the device and prepares it for fast startup. This option must be used with the/s option.
/softAllows running processes and applications to gracefully close instead of forcibly terminating.
/fwCombining this option with a shutdown option causes the next restart to go to the firmware user interface.
/eEnables you to document the reason for an unexpected shutdown of a computer in theShutdown Event Tracker.
/oGoes to theAdvanced boot options menu and restarts the device. This option must be used with the/r option.
/fForces running applications to close without warning users.
Caution: Using the/f option might result in loss of unsaved data.
/m\\<computername>Specifies the target computer.
/t<xxx>Sets the time-out period before shutdown toxxx seconds. The valid range is 0-315360000 (10 years), with a default of 30. If the timeout period is greater than 0, the/f parameter is implied.
/d[p \| u:]<xx>:<yy>Lists the reason for the system restart or shutdown. The supported parameter values are:
  • P - Indicates that the restart or shutdown is planned.
  • U - Indicates that the reason is user-defined.
    Ifp oru aren't specified, the restart or shutdown is unplanned.

  • xx - Specifies the major reason number (a positive integer, less than 256).
  • yy Specifies the minor reason number (a positive integer, less than 65536).
/c<comment>Enables you to create a custom reason for the system shutdown or restart, which must be enclosed in double quotation marks. You can use a maximum of 512 characters. Can also be used with the/d parameter.
/?Displays help at the command prompt, including a list of the major and minor reasons that are defined on your local computer.

Remarks

  • Users must be assigned theShut down the system user right to shut down a local or remotely administered computer that is using theshutdown command.

  • Users must be members of theAdministrators group to annotate an unexpected shutdown of a local or remotely administered computer. If the target computer is joined to a domain, members of theDomain Admins group might be able to perform this procedure. For more information, see:

  • If you want to shut down more than one computer at a time, you can callshutdown for each computer by using a script, or you can useshutdown /i to display theRemote Shutdown box.

  • If you specify major and minor reason codes, you must first define these reason codes on each computer where you plan to use the reasons. If the reason codes aren't defined on the target computer, Shutdown Event Tracker can't log the correct reason text.

  • Remember to indicate that a shutdown is planned by using/d p|u:xx:yy, wherexx andyy represent the major and minor reason codes. Not using the/d parameter might cause the shutdown to be logged without a specified reason. Using the/d parameter for an unplanned shutdown allows the shutdown to be logged correctly.

The shutdown or restart reasons uses the following legend:

  • E: Expected - An expected shutdown or restart that is planned and communicated in advance.
  • U: Unexpected - An unexpected shutdown or restart occurs where the system stops working due to an error, such as a system crash, power failure or other.
  • P: Planned - A planned shutdown or restart scheduled in advance, such as system maintenance, software installation or other.
  • C: Customer Defined - Specify a custom reason for the system shutdown or restart.
Reason typeMajorMinorDescription
U00Other (Unplanned)
E00Other (Unplanned)
E or P00Other (Planned)
U05Other Failure: System Unresponsive
E11Hardware: Maintenance (Unplanned)
E or P11Hardware: Maintenance (Planned)
E12Hardware: Installation (Unplanned)
E or P12Hardware: Installation (Planned)
E22Operating System: Recovery (Unplanned)
E or P22Operating System: Recovery (Planned)
P23Operating System: Upgrade (Planned)
E24Operating System: Reconfiguration (Unplanned)
E or P24Operating System: Reconfiguration (Planned)
P216Operating System: Service pack (Planned)
217Operating System: Hot fix (Unplanned)
P217Operating System: Hot fix (Planned)
218Operating System: Security fix (Unplanned)
P218Operating System: Security fix (Planned)
E41Application: Maintenance (Unplanned)
E or P41Application: Maintenance (Planned)
E or P42Application: Installation (Planned)
E45Application: Unresponsive
E46Application: Unstable
U515System Failure: Stop error
U519Security issue (Unplanned)
E519Security issue (Unplanned)
E or P519Security issue (Planned)
E520Loss of network connectivity (Unplanned)
U611Power Failure: Cord Unplugged
U612Power Failure: Environment
P70Legacy API shutdown

Examples

To force apps to close and to restart the local computer after a one-minute delay, with the reasonApplication: Maintenance (Planned) and the comment "Reconfiguring myapp.exe", type:

shutdown /r /t 60 /c "Reconfiguring myapp.exe" /f /d p:4:1

To perform a planned shutdown of a device in 10 minutes and capture the reason in the shutdown event tracker with the comment "Scheduled maintenance", type:

shutdown.exe /s /t 600 /d p:0:0 /e /c "Scheduled maintenance"

To restart the remote computermyremoteserver with the same parameters as the previous example, type:

shutdown /r /m \\myremoteserver /t 60 /c "Reconfiguring myapp.exe" /f /d p:4:1

To restart the remote computermyremoteserver in 5 minutes due to a security update and include a custom reason in the shutdown event tracker, type:

shutdown /r /t 300 /e /c "Security Update" /m \\myremoteserver

Related links


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?