• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Shut down a computer from the command prompt or remotely via Telnet.

To Open

Command Prompt shutdown


shutdown [-command] [-f] [-m \\computername] [-t xx]
  [-c "comment"] [-d [u][p]:xx:yy]


Shutdown is used to perform a graceful shut down of the computer from the command line; it is useful if you wish to automate the shutdown of computer or if you need to shutdown and you don't have access to the Start menu. This tool can be used to shut down the computer with a Windows shortcut, from a script or batch file, via Scheduled Tasks, or remotely using a Telnet client.

Shutdown uses the following command-line parameters:


Command can be one of the following:


Displays the same Shut Down window used by going to Shart Shut Down. If the -i option is specified with other options, it must be the first option.


Logs off (cannot be used with -m option). Whether a logon window is shown depends on system preferences.


Shuts down the computer.


Restarts the computer.


Aborts a system shutdown in progress; only applicable if using a timed shutdown and there's enough time to type shutdown -a.

-m \\ computername

Shuts down a remote computer; works with all commands except for -l. Note that you must have administrator privileges on the remote computer.

-t xx

Sets a timed countdown before the shutdown is performed. This command gives other users who are currently logged in time to save their work and log out. The default is 30 seconds; specify 0 (zero) to skip the countdown.

-c " comment"

Specifies a text message to be shown to other currently logged-on users while the countdown commences; comment must be enclosed in quotes and can be a maximum of 127 characters long.


Forces running applications to close without warning. Normally, all running applications are notified of a shutdown and are allowed to close gracefully (prompting users to save their work, for example). The -f option will result in a quicker shutdown, but some data loss may occur.

-d [ u][ p]:xx: yy

Specifies the reason code for the shutdown, where u is the user code, p is a planned shutdown code, xx is the major reason code (a positive integer less than 256), and yy is the minor reason code (a positive integer less than 65536). Some applications use these codes to perform certain cleanup operations and even to reject shutdowns under certain circumstances.

If you type shutdown without any arguments, you'll see a brief help page. To perform a simple shutdown after a 30-second warning, type shutdown -s. To restart the computer without any countdown, type shutdown -r -t 0.


Using the -l command with Shutdown (to log off) may produce undesired effects, such as some services stopping unexpectedly. Make sure you test this feature before using it in the field.

See Also

Shut Down in Chapter 3

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint