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.
Restart and Record Reason
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
Using the shutdown command shown here, the current computer is immediately logged off. No warning message is displayed.
Shut Down Remote Computer
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
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
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.