The shutdown command lets you shut down a Windows computer from the command line. It also has additional features that are not available in Windows.

Availability

Shutdown is an external command available for the following Microsoft Windows operating systems as shutdown.exe.

The shutdown command closes the prompt window and then starts shutting down Windows. The result is the same as if you chose Start menu → Power button → Shut down. If you want to close the command line window only, see: How to close or exit the Windows command line.

  • Availability

  • Shutdown syntax

  • Shutdown examples

  • Windows XP

  • Windows Vista

  • Windows 7

  • Windows 8

  • Windows 10

  • Windows 11

Shutdown syntax

Windows 10 and 11 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”]]

Windows 8 syntax

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

Windows Vista and 7 syntax

shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] [/m \computer] [/t xxx][/d [p|u:]xx:yy [/c “comment”]]

Windows XP syntax

shutdown [-i | -l | -s | -r | -a] [-f] [-m \computername] [-t xx] [-c “comment”] [-d up:xx:yy]

Shutdown examples

shutdown -r -c “Rebooting for latest updates.”

This command would display a Windows system shutdown window for 30 seconds. This window would warn the user that the computer shuts down and then restarts the computer.

  • Windows 10 and 11 syntax
  • Windows 8 syntax
  • Windows Vista and 7 syntax
  • Windows XP syntax

The earlier version of the shutdown command uses a dash (-) instead of a forward slash (/) for its options.

shutdown -i

Ran from either the command line or from the Windows run line, this option would open the remote shutdown dialog window.

shutdown /h

Place the computer in hibernation mode in Windows.

shutdown /l

Immediately logs off the current user in Windows.

shutdown /s /t 60

Shuts down the computer after 60 seconds.

shutdown /s /m \PC123 /t 20

Shuts down remote computer name “PC123” after 20 seconds.

shutdown /s /t 45   shutdown /a

The first command initiates a computer shutdown after 45 seconds. The second command aborts the shutdown if it’s executed in the shutdown timeout period, which is 45 seconds in this example.

  • How to shut down or restart the computer with a batch file.
  • How to remotely shutdown another Windows computer.