The shutdown command is a Command Prompt command that powers off, restarts, logs off, or hibernates your computer. The same one can be used to remotely shut down or restart a computer you have access to over a network.

In some ways, it’s similar to the logoff command.

Shutdown Command Availability

The shutdown command is available from the Command Prompt in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP operating systems.

Shutdown Command Syntax

The command follows the following syntax:

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

If you don’t know how to read command syntax, below is a breakdown of what all that means.

The availability of certain command switches and other syntax may differ from operating system to operating system.

Shutdown Command Examples

Here are a few examples that show how to use the shutdown command:

Each time Windows is shut down or restarted manually, including through the shutdown command, the reason, type of shutdown, and [when specified] comment are recorded in the System log in Event Viewer. Filter by the USER32 source to find the entries.

Save the output of the shutdown command to a file using a redirection operator.

Restart and Record Reason

shutdown /r /d p:0:0

In the above example, the shutdown command restarts the computer that’s currently being used and records a reason of Other (Planned). The restart is designated by /r, and the reason is specified with the /d option, with p representing that the restart is planned and the 0:0 indicating an “Other” reason.

Remember, major and minor reason codes on a computer can be displayed by executing shutdown without options and referencing the Reasons on this computer table that’s displayed.

Log Out Immediately

shutdown /l

Using the shutdown command shown here, the current computer is immediately logged off. No warning message is displayed.

Shut Down Remote Computer

shutdown /s /m \SERVER /d p:0:0 /c “Planned restart by Tim”

In the above shutdown command example, a remote computer named SERVER is shut down with a recorded reason of Other (Planned). A comment is also recorded as Planned restart by Tim. Since no time is designated with the /t option, the shutdown will begin on SERVER 30 seconds after executing the shutdown command.

Shut Down Local Computer

shutdown /s /t 0

This shutdown command is used to shut down the local computer immediately since we designated a time of zero with the shutdown /t option.

You could easily change the zero in this command to 10 to delay the shutdown for several seconds, 60 to make the computer shut down in one minute, etc.

Cancel Pending Shutdown

shutdown /a

Finally, in this last example, the shutdown command is canceled before it can complete. It applies to any restart or shutdown command. You might use it to cancel something like a timed restart scheduled for, say, two minutes from now.

Shutdown Command & Windows 8

Microsoft made it more difficult to shut down Windows 8 than they did with previous versions of Windows, prompting many to search out a way of shutting down through a command.

You can certainly do that by executing shutdown /p, but there are several other, albeit more accessible, ways of doing so.

With the return of the Start Menu in Windows 10, Microsoft again made shutting down your computer easy with the Power option.

To avoid commands altogether, you can install one of the best start menu replacements for Windows 8 to make it easier to shut down and restart the computer.

Get the Latest Tech News Delivered Every Day

  • How to Properly Reboot (Restart) a Windows Computer

  • How to Force Windows to Restart in Safe Mode

  • How to Change the Screen Timeout in Windows 11

  • How to Create a Shutdown Timer in Windows 10

  • How to Access Advanced Startup Options in Windows 11, 10, or 8

  • 16 Best Free Remote Access Software Tools

  • How to Use the Netstat Command

  • How to Use the ‘At’ Command in Windows

  • Vol Command Examples and Options

  • How to Resolve Limited or No Connectivity Errors in Windows

  • How to Open Command Prompt (Windows 11, 10, 8, 7, etc.)

  • How to Use the Netstat Command on Mac

  • How to Reset a Windows Vista Password

  • 21 Best Command Prompt Tricks

  • Net Send Command

  • How to Set Up Auto Login in Windows

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US