How to use shutdown command tool on Windows 10 (2022)

How to use shutdown command tool on Windows 10 (1)

Although, on Windows 10, you can conveniently sign out, shut down, restart, or hibernate your computer from the Start menu or Lock screen, the system also includes the shutdown.exe tool that allows you to perform the same power operations through Command Prompt.

It is also a more powerful tool since, in addition to the common tasks, the command-line tool supports more advanced options, including the ability to record the reason for the event, display custom messages to the end-user, and even use the tool shut down and restart remote devices.

You can use this tool at any time. However, it will usually come in handy if you spend most of your time in the Command Prompt terminal, you need to create a script that involves restarting the computer, or you are making system changes, and you want to record a reason for the restart or shutdown event.

In this Windows 10 guide, we will walk you through the different ways you can use the shutdown.exe command-line tool to shut down and restart local and remote computers.

  • How to turn off computer with shutdown command
  • How to turn off remote computer with shutdown command
  • How to restart computer with shutdown command
  • How to sign out session with shutdown command
  • How to hibernate computer with shutdown command
  • How to boot in firmware mode with shutdown command
  • How to access the Advanced boot options with shutdown command
  • How to abort computer power off operation with shutdown command

How to turn off computer with shutdown command

To shut down the computer manually with Command Prompt, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to gracefully shut down the device after one minute and press Enter:shutdown /s
  4. Type the following command to shut down the device after a specific time and press Enter:shutdown /s /t TIMEIn the command, replace TIME for the second to wait before the device begins the shutdown process.For example, this command turns off the computer after five seconds:shutdown /s /t 5Quick tip: You can also use "0" for the time for shutdown immediately. If the time is greater than zero, then the /f option will be applied automatically.

How to use shutdown command tool on Windows 10 (2)

  1. Type the following command to shut down the computer without waiting or warning and press Enter:shutdown /p
  2. Type the following command to shut down, forcing all apps to close without warning, and press Enter:shutdown /s /f

Once you complete the steps, the computer will execute the shutdown process depending on your specified options.

(Video) How to Shutdown Windows 10 With CMD Timer Shutdown - Command Prompt Tutorial 2022

Shut down specifying reason

To turn off the device recording a specific reason, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to include a reason for the shutdown and press Enter:shutdown /s /d p:MAJOR-NUMBER:MINOR-NUMBERIn the command, change the MAJOR-NUMBER:MINOR-NUMBER for the numbers that represent the reason. You can find out all the available major and minor reason numbers by running the shutdown /? command.For example, this command shuts down the device, recording the "Operating System: Service pack (Planned)" reason:shutdown /s /t 1 /d p:2:16You can also switch the /s for the /r option if you want to specify a reason for the restart in the command. Here's how:shutdown /r /t 1 /d p:2:16

How to use shutdown command tool on Windows 10 (3)

  1. Type the following command to power off the computer specifying a reason as unplanned and press Enter:shutdown /s /t 1 /d u:2:16The above command will shut down the device, recording the "Operating System: Service pack (Unplanned)" reason.

After you complete the steps, the Windows 10 device will shut down and log the specified reason.

You can always view the shutdown logs in Event Viewer > Windows Logs > System and look for the "Information" event with the User32 source and with the "Event ID" of 1074.

Shut down with custom dialog message

To shut down a computer showing a dialog message alerting the user of the action, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to shutdown device showing custom dialog message and press Enter:shutdown /s /t TIME /c "MESSAGE"In the command, replace TIME with the number of seconds before shutting down the computer, and replace MESSAGE with the custom text you want to display to the user.For example, this command displays the "Updating XYZ company app" before shutting down the computer after one minute:shutdown /s /t 60 /c "Updating XYZ company app."You can also switch the /s for the /r option if you want to show a message for the restart in the command. Here's how:shutdown /r /t 60 /c "Updating XYZ company app."

How to use shutdown command tool on Windows 10 (4)

Once you complete the steps, Windows 10 will display the "Updating XYZ company app" message to the user and power off the computer after 60 seconds.

How to turn off remote computer with shutdown command

The shutdown command-line tool also allows you to turn off or restart a device remotely. However, the tool is limited, and you will be performing some extra steps to get it working.

Configure remote device

To set up the remote computer to allow remote command executions, use these steps:

Warning: This is a friendly reminder that editing the Registry is risky and can cause irreversible damage to your installation if you don't do it correctly. It's recommended to make a full backup of your PC before proceeding.

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to disable the User Account Control for remote executions and press Enter:reg add HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

How to use shutdown command tool on Windows 10 (5)

After you complete the steps, the device will be open to receive commands remotely from authenticated users.

(Video) How to shutdown someones Computer/Laptop using CMD ( Command Prompt )

If you want to revert the changes to improve the device security, you can use the same instructions outlined above, but on step No. 3, make sure to run this command:

reg add HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 0 /f

.

Shut down remote device

To use the Command Prompt to shut down a computer remotely, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to connect to the IPC$ share (or null session connection) and press Enter:net use \\REMOTE-PC\ipc$In the command, replace REMOTE-PC for the name or IP address of the remote computer.For example, this command connects to the Office-PC computer:net use \\Office-PC\ipc$
  4. Confirm the account name located in the remote device and press Enter.
  5. Confirm the account password and press Enter.
  6. Type the following command to restart the remote computer and press enter:shutdown /r /m \\REMOTE-PC /t TIME /c "COMMENT" /fIn the command, replace REMOTE-PC for the name or IP address of the remote computer, TIME for the number of seconds to wait before beginning the shutdown process, and replace COMMENT for the custom dialog you want to send the user.For example, this command will notify the user, and forces a restart the device called "Office-PC" closing all application without warnings after one minute:shutdown /r /m \\Office-PC /t 60 /c "This PC will restart in one minute for maintenance." /fIf no one is using the computer, you can send a command that restarts the device immediately. Here's an example:shutdown /r /m \\Office-PC /t 0 /f

How to use shutdown command tool on Windows 10 (6)

Once you complete the steps, the remote host will power off according to the command configuration.

If you want to disconnect from the IPC$ share, run the following command: "net use * /delete" (without quotations) and press Y to confirm. If you plan to use this command, you may need to remap previously connected network drives.

How to restart computer with shutdown command

To restart a Windows 10 device with Command Prompt, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to restart the device and press Enter:shutdown /r
  4. Type the following command to restart the device after a specific time and press Enter:shutdown /r /t TIMEIn the command, replace TIME for the second to wait before the device begins the restart process.For example, this command restarts the computer after five seconds:shutdown /r /t 5Quick tip: You can also use "0" for the time to restart the device immediately.

How to use shutdown command tool on Windows 10 (7)

  1. Type the following command to restart without waiting or warning and press Enter:shutdown /r /p
  2. Type the following command to shut down, forcing all apps to close without warning, and press Enter:shutdown /r /f

After you complete the steps, the computer will restart according to the options you specified in the command.

How to sign out session with shutdown command

The shutdown tool also includes an option to sign out a user, but it is only available for the local computer, and you can only sign out the current session. You cannot log off other users or someone on a remote device.

To log off of a Windows 10 account with Command Prompt, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to sign out the current account session and press Enter:shutdown /L

How to use shutdown command tool on Windows 10 (8)

(Video) How to Restart/Power off Windows 10 PC/Laptop Using Run Command

Once you complete the steps, the current user session will be signed out.

How to hibernate computer with shutdown command

To put the computer into a hibernate state with a command, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to hibernate the device and press Enter:shutdown /h

How to use shutdown command tool on Windows 10 (9)

After you complete the steps, the device will enter into the hibernation state. However, this only works on devices that support the feature. You can use these steps to enable and configure hibernation on Windows 10.

How to boot in firmware mode with shutdown command

The command-line tool even includes an option to start the computer into the Unified Extensible Firmware Interface (UEFI) or Basic Input Output System (BIOS) firmware without the need for extra steps.

To start the device in the UEFI or BIOS interface, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to restart the device into the firmware and press Enter:shutdown /r /fw

How to use shutdown command tool on Windows 10 (10)

  1. Type the following command to shut down the computer and boot into the firmware during the next startup and press Enter:shutdown /s /fwAlternatively, you can also use the /p instead of the /s option to close all running applications and force the shutdown without warning.

Once you complete the steps, the computer will boot into the firmware interface.

How to access the Advanced boot options with shutdown command

The "Advanced boot options" experience is the environment that includes various tools to troubleshoot and fix problems on Windows 10. Although you can use the Settings app or the USB flash drive to access these tools, you can also get into this experience with one shutdown command.

To start the computer in the Advanced boot options, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to restart the device into the Advanced boot options experience and press Enter:shutdown /r /o
  4. Type the following command to shut down the computer and start the Advanced boot options experience during the next startup and press Enter:shutdown /s /oAlternatively, you can also use the /p instead of the /s option to close all running applications and force the shutdown without warning.

How to use shutdown command tool on Windows 10 (11)

After you complete the steps, the computer will start in the Advanced boot tools, allowing you to access recovery tools to troubleshoot and fix the installation.

(Video) How to do Remote Shutdown Windows 10 PC in Command Prompt?

How to abort computer power off operation with shutdown command

This option is only available when using the time-out option on a remote computer. If the computer is scheduled to shut down after a specific period, you can abort the process.

To abort a shutdown, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to abort the shutdown and press Enter:shutdown /a /m \\REMOTE-PCIn the command, replace REMOTE-PC with the name or IP address of the remote computer.For example, this command aborts the shutdown action on the remote computer called Office-PC:shutdown /a /m \\Office-PC

How to use shutdown command tool on Windows 10 (12)

In these steps, it is assumed you successfully ran the shutdown command, meaning that you went through the steps to configure the local computer and remote devices to allow the remote command execution (see above instructions).

We are focusing this guide on Windows 10, but the command-line tool has been available for a long time, which means you can refer to these instructions if you are still using Windows 8.x. Shutdown.exe is also available for Windows 7, but the options are limited. For example, the

/o

and

/hybrid

are available starting Windows 8.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

  • Windows 10 on Windows Central – All you need to know
  • Windows 10 help, tips, and tricks
  • Windows 10 forums on Windows Central

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

FAQs

How to use shutdown command tool on Windows 10? ›

Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to gracefully shut down the device after one minute and press Enter: shutdown /s.

What is shutdown command in CMD? ›

shutdown /s command will shut down the system you are working on. shutdown / i from the command prompt will open the Remote Shutdown Dialog window, this will provide options available via an easy to use interface including networked systems.

How can I shutdown my laptop using CMD? ›

Shutdown a remote computer using GUI
  1. Press Windows key + R on the keyboard to open the Run dialog.
  2. Type shutdown /i command and click the OK button.
  3. Click the Add button.
  4. Enter the computer name or IP address of the remote computer.
  5. Click the OK button.
  6. (Optional) Repeat steps No.
Jul 15, 2022

How do I remotely restart a Windows 10 computer? ›

Answer: Go to the CMD and type shutdown –r –m \\ machine name –t -01 and press enter from the keyboard.
...
Frequently Asked Questions
  1. Press Windows +R on the keyboard, then the run CMD will appear on the screen.
  2. Now type shutdown /r /t 0. ...
  3. This will restart the system.
Aug 7, 2022

How do I use shut down? ›

The Alt + F4 keyboard shortcut closes any open program and is also used as a keyboard shortcut to shutdown Windows. From the Windows desktop, press Alt + F4 to open the Shut Down Windows window. If the selected option is Shut down, press the Enter to confirm the shutdown.

Is there a shortcut to shutdown Windows 10? ›

Alt-F4 instantly makes this box appear. An oldie but goodie, pressing Alt-F4 brings up a Windows shut-down menu, with the shut-down option already selected by default. (You can click the pull-down menu for other options, like Switch User and Hibernate.) Then just press Enter and you're done.

Videos

1. How to Shutdown Windows 10 PC Using COMMAND
(Swastik Tech)
2. Windows Command Line Tutorials - Tutorial 21 - shutdown command
(Open ESchool)
3. How to Schedule an Automatic Shutdown in Windows 10 using the Command Prompt
(Call That Geek Videos)
4. How To Shutdown Your Laptop using Command Prompt(Cmd)
(Factual Funda)
5. Schedule your Shutdown in PC using CMD || Command Prompt || Windows 11,10,8,7 || Full Details
(Tech Blurrr)
6. CMD How to Use Shutdown Command in CMD Hindi (2021)
(Askmemore AboutComputer)

Top Articles

You might also like

Latest Posts

Article information

Author: Fr. Dewey Fisher

Last Updated: 11/12/2022

Views: 5973

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.