How to use shutdown command tool on Windows 10

Although, in Windows 10, you can log out, shut down, restart, or hibernate your computer from the Start menu or lock screen, the system also includes the shutdown tool.exe which allows you to perform the same power operations through the command prompt.

It’s also a more powerful tool since, in addition to 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 to shut down and restart remote devices.

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

This guide will guide you through how to use the shutdown.exe command-line tool to shut down and restart local and remote computers.

How

to shut down your computer with the shutdown command

To shut down your computer manually by using the command prompt, follow these steps:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click the top result, and select the Run as administrator option.
  4. Type the following command to properly shut down the device after one minute and press Enter: shutdown /s

  5. Type the following command to shut down the device after a specific time and press Enter: shutdown /s /t TIME In the command
  6. , replace TIME

for the second you wait before the device starts the shutdown process. For example, this command shuts down the computer after five seconds: shutdown /s /t 5

  • Quick tip: You can also use “0″ during the time to turn off the device immediately. If the time is greater than zero, the /f option is automatically applied.
(Image credit: Future)

Type the following command to shut down the computer without waiting or warning and press Enter: shutdown /

    p

  1. Type the following command to shut down, forcing all applications to close without warning, and press Enter: shutdown /s /f Once you complete the steps,
  2. the computer will run the shutdown process according to the specified options.

Shut down by specifying the

reason

To turn off device recording for a specific reason in Windows 10, follow these steps

:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click the top result, and select the Run as administrator option.
  4. Type the following command to include a reason for shutdown, and then press Enter: shutdown /s /d p:MAJOR-NUMBER:MINOR-NUMBER

In the command, change MAJOR-NUMBER:MINOR-NUMBER to the numbers that represent the reason. You can determine all available major and minor ratio numbers by running the shutdown /? command. For example, this command shuts down the device, registering the “Operating system: Service pack (planned)” reason: shutdown /s /t 1 /d p:2:16. You can also change 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(Image credit: Future)

  1. Type the following command to shut down the computer specifying a reason as unplanned and press Enter: shutdown /s /t 1/d u:2:16

The above command will shut down the device, recording the reason “Operating system: Service pack (unplanned)”.

After completing the steps, the Windows 10 device will shut down and record the specified reason.

You can always view the shutdown logs in Event Viewer > Windows > System Logs 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 that displays a dialog message that alerts the user of the action, follow these steps:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click the top result, and select the Run as administrator option.
  4. Type the following command to shut down the device that displays a custom dialog message, and then 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 that you want to display to the user. For example, this command displays “Updating company application XYZ” before shutting down the computer after one minute: shutdown /s /t 60 /c “Updating company application XYZ.” You can also change the /s for the /r option if you want to display a message for the restart in the command. Here’s how: Shut down /r /t 60/c”XYZ Company App Update

.”

(Image Credit: Future)

Once you complete the steps, Windows 10 will display the message “Updating XYZ Company App” to the user and shut down the computer after 60 seconds.

How to shut down the

remote computer with the

shutdown command

The shutdown command-line tool also allows you to remotely shut down or restart a device. However, the tool is limited and will perform additional steps to make it work.

Configure remote device

To configure the remote computer to allow remote command executions, follow these steps

:

Warning: This is a friendly reminder that editing the registry is risky and can cause irreversible damage to your installation if you do not do it correctly. It is recommended to make a full backup of your computer before proceeding.

  1. Open Start
  2. .

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

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

If you want to roll back the changes to improve device security, you can use the same instructions described above, but in step 3, be 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, follow these steps:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click the top result, and select the Run as administrator option.
  4. type the following command to connect to the ipc$ share (or null session connection) and then press enter : net use \\REMOTE-PCipc$

In the command, replace REMOTE-PC with the name or IP address of the remote computer. For example, this command connects to the computer: net use \\10.1.4.120\ipc$

Confirm the name of the account located on the remote device and press Enter.

  1. Confirm the account password
  2. and press Enter.

  3. Type the following command to restart the remote computer, and then press Enter: shutdown /r /m \\REMOTE-PC /t TIME /c “COMMENT” /f
  4. In

  5. the

command, replace

REMOTE-PC with the name or IP address of the remote computer, TIME with the number of seconds you must wait before starting the shutdown process, and replace COMMENT with the custom dialog box that you want to send to the user. For example, this command will notify the user and force the device to close all applications without warnings after one minute: shutdown /r /m \\10.1.4.120 /t 60 /c “This PC will restart in one minute for maintenance.” /f. If no one is using the computer, you can immediately send a command that restarts the device. Here is an example: shutdown /r /m \\10.1.4.120 /t 0 /f

(

Image credit: Future

)Once you complete the steps, the

remote host will shut down according to the command settings.

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

How to restart the computer with the

shutdown command

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

  1. Open Start
  2. .

  3. Find Command Prompt, right-click on the top result and select the Run as administrator option.
  4. Type the following command to restart the device and press Enter: shutdown /r

  5. Type the following command to restart the device after a specific time and press Enter: shutdown /r /t
  6. TIME In the

  7. command

, replace TIME for the second you wait before the device begins the reboot process. For example, this command restarts the computer after five seconds

: shutdown /r /t 5

  • Quick tip: You can also use “0″ during the time to restart the device immediately.
(Image credit: Future)

Type the following command to restart without waiting or warning and press Enter: shutdown /r /

    p

  1. Type the following command to shut down, forcing all applications to close without warning, and press Enter: shutdown /r /f
  2. After

completing the steps, the computer will restart according to the options specified in the command.

How to log out with the shutdown command

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

To sign out of a Windows 10 account using the command prompt, follow these steps

:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click on the top result, and select the Run as administrator option.
  4. Type the following command to log off the current account session, and then press Enter: shutdown /L
(Image credit: Future)

Once you complete the steps, the

current user session will be closed

.

How to hibernate

your computer with the shutdown command

To put your computer into a hibernation state with a command, follow these steps:

  1. Open Start.
  2. Find Command Prompt, right-click on the top result, and select the option Run as administrator.
  3. Type the following command to hibernate the device and press Enter: shutdown /h
(Image credit: Future)

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

How to boot into firmware

mode with the shutdown

command

The command-line tool even includes an option to boot the computer into the Unified Extensible Firmware Interface (UEFI) or Basic Input/Output System (BIOS) firmware without additional steps. To boot the device into the UEFI

or BIOS interface, follow these steps

:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click on the top result, and select the Run as administrator option.
  4. Type the

  5. following command to restart the device into the firmware and press Enter: shutdown /r /fw
(Image credit: Future)Type

the

  1. next command to shut down the computer and boot the firmware during the next boot and press Enter: shutdown /s /fw Alternatively, you can also use the /p option instead of

/s to close all running applications and force shutdown without warning

.

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

How to access advanced boot options with the shutdown command

The “Advanced Boot Options” experience is the environment that includes several troubleshooting tools in Windows 10. Although you can use the Settings app or USB flash drive to access these tools, you can also access this experience with a shutdown command.

To start your computer in the advanced boot options, follow these steps:

  1. Open Startup
  2. .

  3. Find Command Prompt, right-click the top result, and select the Run as administrator option.
  4. Type the following command to restart the device in the advanced boot options experience, and then press Enter: shutdown /r /o

  5. Type the following command to shut down the computer and start the advanced boot options experience during the next startup, and then press Enter: shutdown
  6. /s /o

Alternatively, you can also use /p instead of /s Option to close all running applications and force shutdown without warning.

(Image credit: Future)

After completing the steps, the computer

will boot into the advanced boot tools, allowing you to access the recovery tools to troubleshoot and fix the installation.

How to abort the computer shutdown operation with the shutdown command

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

To undo a shutdown, follow these steps:

  1. Open Start
  2. .

  3. Find Command Prompt, right-click the top result, and select the Run as administrator option.
  4. Type the following command to unshut down, and then press Enter: shutdown /a /m \\REMOTE-PC In the command, replace REMOTE-PC

with the name or IP address of the remote computer. For example, this command overrides the shutdown action on the remote computer: shutdown /a /m \\10.1.4.120

(Image credit

: Future)

These steps assume that you successfully

ran the shutdown command, which means that you performed the steps to configure the local computer and remote devices to allow the remote command to run (see instructions above).

We’re focusing this guide on Windows 10, but the command-line tool has been around for a long time, which means you can check out these instructions if you’re still using Windows 8.x. Shut down.exe is also available for Windows 7, but the options are limited. For example, the /o and /hybrid options are available starting with Windows 8.

More

resources

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

:Windows 10 in Windows Central

  • : Everything you need to know
  • Windows 10 forums in Windows Central