Shut Down Your Windows Computer from the Command Line

The command prompt is one of the most valuable, yet the most ignored thing on a computer. The command prompt can do many marvelous things. The following article will show you how to shut off your computer with the command prompt.

Steps

  1. Open up the command prompt. On Windows XP, click on start > Run > type in “cmd” (without quotes”) into the window. And on Windows Vista or Windows 7, you can open up the command prompt with the start key and “r”.
  2. To start an instant shutdown, type in: “shutdown.exe -s -t 00 ” without the quotes.
  3. In the command prompt window, type in the following without quotes: “shutdown –s”. A message should appear saying that your computer will shut down in under a minute.
  4. To abort the shutdown process, type in: “shutdown -a” without the quotes, into the command prompt.

Tips

  • For more information on the shutdown process, type in “shutdown help” without the quotes, into the command prompt.

All Shutdown Commands

Shutdown -Command "text"

  • -r Restart computer
  • -s Shutdown computer
  • -t "xxx" Time (the xxx is for seconds)

*-i Shutdown computer on network

  • -c "comment" Comment on the reason for the restart or shutdown. Maximum of 512 characters allowed.
  • -l Log off. This cannot be used with -m or -d options.
  • -g Shutdown and restart the computer. After the system is Rebooted, restart any registered applications.
  • -a Abort a system shutdown.
  • -p Turn off the local computer with no time-out or warning.
  • -h Hibernate the local computer. - Can be used with the -f option.
  • -e Document the reason for an unexpected shutdown of a computer.
  • -m \\computer Specify the target computer.
  • -f Force running applications to close without forewarning users. The /f parameter is implied when a value greater than 0 is specified for the -t parameter.
  • -d [p|u:]xx:yy Provide the reason for the restart or shutdown.

*p indicates that the restart or shutdown is planned. *u indicates that the reason is user defined. *If neither p nor u is specified the restart or shutdown is unplanned. *xx is the major reason number (positive integer less than 256). *yy is the minor reason number (positive integer less than 65536).

Warnings

  • Before you start the shutdown, make sure all other programs are saved. If you don’t, you may lose unsaved data.

Related Articles

  • Close Command Prompt