Home XP Commands
XP Syntax

SHUTDOWN.exe

Shutdown the computer

Syntax

      SHUTDOWN [logoff_option]  [/m \\Computer] [options]

logoff_option:
    /i         Display the GUI (must be the first option)
/l Log off. This cannot be used with /m or /d option
/s Shutdown
/r Shutdown and Restart
/a Abort a system shutdown.
(only during the time-out period) /p Turn off the local computer with no time-out or warning
(only with /d)
/h Hibernate the local computer (only with /f )
/e Document the reason for an unexpected shutdown of a computer options:
/m \\Computer : A remote computer to shutdown. /t:xxx : Time until system shutdown in seconds.
The valid range is xxx=0-600 seconds. [default=30] /c "Msg" : An optional shutdown message [Max 127 chars] /f : Force running applications to close. This will not prompt for File-Save in any open applications. so will result in a loss of all unsaved data!!! /d u:xx:yy : List a USER reason code for the shutdown. /d P:xx:yy : List a PLANNED reason code for the shutdown. xx Specifies the major reason code (0-255) yy Specifies the minor reason code (0-65536) Options in bold are for Windows 2003 only

Example:
To create a desktop shortcut that will immediately shutdown your system - set the shortcut Target Properties to:
C:\Windows\System32\shutdown.exe -s

When using this command to reboot a server, the shutdown process will normally allow about 30 seconds to ensure each running service has time to stop. The shutdown can be made faster if all the services are first halted using NET STOP

e.g.
net stop "Microsoft Exchange Internet Mail Service"
net stop "Microsoft FTP Service"
net stop "Some other Service"
SHUTDOWN /t:25 /r

Typical Reason codes:
E = Expected
 U = Unexpected
   P = planned (C = customer defined)

Type    Major Minor Title
 U      0     0   Other (Unplanned)
E       0     0   Other (Unplanned)
E P     0     0   Other (Planned)
 U      0     5   Other Failure: System Unresponsive
E       1     1   Hardware: Maintenance (Unplanned)
E P     1     1   Hardware: Maintenance (Planned)
E       1     2   Hardware: Installation (Unplanned)
E P     1     2   Hardware: Installation (Planned)
  P     2     3   Operating System: Upgrade (Planned)
E       2     4   Operating System: Reconfiguration (Unplanned)
E P     2     4   Operating System: Reconfiguration (Planned)
  P     2     16  Operating System: Service pack (Planned)
        2     17  Operating System: Hot fix (Unplanned)
  P     2     17  Operating System: Hot fix (Planned)
        2     18  Operating System: Security fix (Unplanned)
  P     2     18  Operating System: Security fix (Planned)
E       4     1   Application: Maintenance (Unplanned)
E P     4     1   Application: Maintenance (Planned)
E P     4     2   Application: Installation (Planned)
E       4     5   Application: Unresponsive
E       4     6   Application: Unstable
 U      5     15  System Failure: Stop error
E       5     19  Security issue
 U      5     19  Security issue
E P     5     19  Security issue
E       5     20  Loss of network connectivity (Unplanned)
 U      6     11  Power Failure: Cord Unplugged
 U      6     12  Power Failure: Environment
  P     7     0   Legacy API shutdown

e.g. SHUTDOWN /r /d P:2:17

"The man who is tired of London is tired of looking for a parking space" - Paul Theroux

Related Commands:

LOGOFF - Log off a user.
BootCFG - Edit Boot.ini settings.
PsShutdown - SysInternals command line tool
PowerOff - Stefan Kuhr utility (NT / 2K)
JSIFAQ Tip 9130 - log off user after n minutes of inactivity



Back to the Top

Simon Sheppard
SS64.com