Shutdown Command
Computers,  Tech

Shutdown Command | Keyboard Shortcut On Windows

Windows 10 offers various ways to shut down or restart your computer, such as using the Start menu, the power button, or the lock screen. However, there is another method that gives you more control and flexibility over the power operations: the shutdown command.

The shutdown command is a tool that you can use in Command Prompt to perform different tasks, such as shutting down, restarting, logging off, hibernating, or booting into advanced options. You can also use the shutdown command to turn off or restart remote computers on your network.

In this article, we will show you how to use the shutdown command in Windows 10 with examples and explanations. We will also provide a list of switches and parameters that you can use with the shutdown command to customize your power operations.

How to Open Command Prompt

Before you can use the shutdown command, you need to open Command Prompt. There are several ways to do this, but here is one of the easiest methods:

  • Press the Windows key + R to open the Run dialog box.
  • Type cmd and click OK or press Enter.

This will open a Command Prompt window where you can type and execute commands.

How to Shut Down Your Computer with the Shutdown Command

To shut down your computer with the shutdown command, you need to use the /s switch. This switch tells the command to initiate a normal shutdown process.

For example, you can type the following command and press Enter:

shutdown /s

This will display a message that Windows will shut down in less than a minute. You can close the message if you want, but it will not affect the shutdown process.

If you want to shut down your computer immediately without waiting or displaying a message, you can use the /p switch instead. For example:

shutdown /p

This will shut down your computer instantly without any warning.

How to Restart Your Computer with the Shutdown Command

To restart your computer with the shutdown command, you need to use the /r switch. This switch tells the command to initiate a normal restart process.

For example, you can type the following command and press Enter:

shutdown /r

This will display a message that Windows will restart in less than a minute. You can close the message if you want, but it will not affect the restart process.

Also Read: How to Format a Drive on Windows 11

How to Schedule a Shutdown or Restart with the Shutdown Command

If you want to schedule a shutdown or restart for a later time, you can use the /t switch with the shutdown command. This switch allows you to specify the number of seconds to wait before executing the power operation.

For example, if you want to schedule a shutdown for 10 minutes later, you can type the following command and press Enter:

shutdown /s /t 600

This will display a message that Windows will shut down in 10 minutes. The number 600 represents the number of seconds to wait before shutting down. You can change this number according to your preference.

Similarly, if you want to schedule a restart for 5 minutes later, you can type the following command and press Enter:

shutdown /r /t 300

This will display a message that Windows will restart in 5 minutes. The number 300 represents the number of seconds to wait before restarting. You can change this number according to your preference.

How to Cancel a Scheduled Shutdown or Restart with the Shutdown Command

If you have scheduled a shutdown or restart with the shutdown command and changed your mind, you can cancel it with the /a switch. This switch tells the command to abort any scheduled power operation.

For example, if you have scheduled a shutdown for 10 minutes later and want to cancel it, you can type the following command and press Enter:

shutdown /a

This will display a message that Windows has canceled the scheduled shutdown. You can close the message if you want.

How to Log Off Your User Account with the Shutdown Command

To log off your user account with the shutdown command, you need to use the /l switch. This switch tells the command to log off the current user session.

For example, you can type the following command and press Enter:

shutdown /l

This will log off your user account and take you back to the sign-in screen.

How to Hibernate Your Computer with the Shutdown Command

To hibernate your computer with the shutdown command, you need to use the /h switch. This switch tells the command to put your computer into hibernation mode.

Hibernation is a power-saving state that saves your current session on your hard disk and turns off your computer. When you turn on your computer again, it resumes from where you left off.

For example, you can type the following command and press Enter:

shutdown /h

This will put your computer into hibernation mode and turn it off.

Note: To use the /h switch, you need to enable hibernation on your computer first. You can do this by following these steps:

  • Open Control Panel and click on Hardware and Sound.
  • Click on Power Options and then click on Choose what the power buttons do.
  • Click on Change settings that are currently unavailable and then check the box next to Hibernate (Show in Power menu).
  • Click on Save changes and close the window.

How to Boot into Advanced Options with the Shutdown Command

To boot into advanced options with the shutdown command, you need to use the /o switch. This switch tells the command to restart your computer and open the advanced options menu.

The advanced options menu allows you to access various troubleshooting and recovery tools, such as Startup Repair, System Restore, Safe Mode, Command Prompt, and more.

For example, you can type the following command and press Enter:

shutdown /r /o

This will restart your computer and take you to the advanced options menu.

Note: To use the /o switch, you need to use it with the /r switch. You cannot use it with the /s or /h switches.

How to Boot into Firmware Settings with the Shutdown Command

To boot into firmware settings with the shutdown command, you need to use the /fw switch. This switch tells the command to restart your computer and open the firmware settings menu.

The firmware settings menu allows you to access and modify various hardware and system settings, such as boot order, security options, device configuration, and more.

For example, you can type the following command and press Enter:

shutdown /r /fw

This will restart your computer and take you to the firmware settings menu.

Note: To use the /fw switch, you need to use it with the /r switch. You cannot use it with the /s or /h switches.

How to Shut Down or Restart a Remote Computer with the Shutdown Command

To shut down or restart a remote computer with the shutdown command, you need to use the /m switch. This switch allows you to specify the name or IP address of the remote computer that you want to control.

For example, if you want to shut down a remote computer named PC01, you can type the following command and press Enter:

shutdown /s /m PC01

This will display a message that Windows will shut down PC01 in less than a minute.

Similarly, if you want to restart a remote computer with an IP address of 192.168.1.100, you can type the following command and press Enter:

shutdown /r /m 192.168.1.100

This will display a message that Windows will restart 192.168.1.100 in less than a minute.

Note: To use the /m switch, you need to have administrative privileges on both your local and remote computers. You also need to enable remote access on the remote computer by following these steps:

  • Open Control Panel and click on System and Security.
  • Click on Allow remote access and then click on Select users who can remotely access this PC.
  • Click on Add and then type the name of your local user account or group.
  • Click on Check names and then click on OK.
  • Click on Apply and then click on OK.

How to Display a Custom Message with the Shutdown Command

To display a custom message with the shutdown command, you need to use the /c switch. This switch allows you to add a comment of up to 512 characters that will be shown to the user before executing the power operation.

For example, if you want to display a message that says “System maintenance in progress” before shutting down your computer, you can type the following command and press Enter:

shutdown /s /c "System maintenance in progress"

This will display a message that says “System maintenance in progress” and Windows will shut down in less than a minute.

You can also use this switch with other power operations, such as restart, log off, hibernate, or remote control.

How to Specify a Reason for Shutdown or Restart with the Shutdown Command

To specify a reason for shutdown or restart with the shutdown command, you need to use the /d switch. This switch allows you to record a reason for the power operation in the event log.

The reason consists of two parts: a major reason code and a minor reason code. Each code is represented by a number that corresponds to a predefined category or description.

For example, if you want to record a reason that says “Planned hardware maintenance” before shutting down your computer, you can type the following command and press Enter:

shutdown /s /d p:1:1

This will record a reason that says “Planned hardware maintenance” in the event log and Windows will shut down in less than a minute.

You can also use the /d switch with other power operations, such as restart, log off, hibernate, or remote control.

How to List All the Switches and Parameters for the Shutdown Command

To list all the switches and parameters for the shutdown command, you can use the /? switch. This switch tells the command to display the help information on the screen.

For example, you can type the following command and press Enter:

shutdown /?

This will display a list of all the switches and parameters that you can use with the shutdown command, along with their descriptions and examples.

Here is a summary of the switches and parameters for the shutdown command:

SwitchParameterDescription
/sNoneShuts down the computer.
/rNoneRestarts the computer.
/pNoneShuts down the computer without displaying a message or waiting.
/hNoneHibernates the computer.
/lNoneLogs off the current user.
/oNoneRestarts the computer and opens the advanced options menu.
/fwNoneRestarts the computer and opens the firmware settings menu.
/aNoneAborts a scheduled shutdown or restart.
/m computernamecomputername or IP address of a remote computer.Shuts down or restarts a remote computer.
/t xxxxxx is the number of seconds to wait before executing the power operation.Sets a time-out period for a scheduled shutdown or restart.
/c “commentcomment is a custom message of up to 512 characters that will be displayed before executing the power operation.Adds a comment to a scheduled shutdown or restart.
/d [*pu:]xx:yy*p indicates that the power operation is planned.<br>u indicates that the power operation is unplanned.<br>xx is the major reason code (0-255).<br>yy is the minor reason code (0-65536).
/?NoneDisplays help information for the shutdown command.

How to Use Mermaid Diagrams with Markdown

Mermaid is a tool that allows you to create diagrams and charts with simple text syntax. You can use mermaid diagrams with markdown to enhance your article with visual elements.

To use mermaid diagrams with markdown, you need to follow these steps:

  • Install mermaid on your computer or use an online editor such as [Mermaid Live Editor].
  • Write your diagram code using mermaid syntax in a code block with “`mermaid as the first line.
  • Save your diagram code as a .mmd file or copy it to your clipboard.
  • Insert your diagram code into your markdown document using one of these methods:
    • If you have saved your diagram code as a .mmd file, you can use an image tag with !alt text syntax, where alt text is a description of your diagram and file.mmd is the name of your .mmd file.
    • If you have copied your diagram code to your clipboard, you can use an image tag with !alt text syntax, where alt text is a description of your diagram and … is your diagram code encoded in base64 format. You can use an online tool such as [Base64 Image Encoder] to convert your diagram code to base64 format.
  • Preview or render your markdown document to see your diagram.

Conclusion

Shutting down Windows via CMD is a powerful and versatile way to control the shutdown process. By using the various options available with the shutdown command, you can customize the shutdown process to meet your specific needs.

Towoju Olajide is a technology writer who covers topics ranging from consumer tech to the latest developments in artificial intelligence. Born and raised in Nigeria, Towoju developed an early fascination with technology that led him to pursue a degree in Computer Science. After completing his studies, he worked as a software developer for several years before transitioning into tech journalism.Towoju's work has been featured in various publications, including TechCrunch, Wired, and The Verge. He is also a regular contributor to several technology blogs and podcasts, where he shares his insights on emerging trends and breakthroughs in the tech industry. In addition to his work as a writer, Towoju is an avid photographer and enjoys capturing the beauty of nature and wildlife in his spare time.Over the years, Towoju has written several books on technology and its impact on society. His writing has been praised for its ability to break down complex concepts into simple, easy-to-understand language. Whether he's exploring the latest advancements in AI or discussing the future of smart cities, Towoju's goal is to make technology accessible to everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *