How to use shutdown command tool on Windows 10
Yes, you can shut down and restart a computer with Command Prompt, and in this guide, we’ll show you how on Windows 10.
When you purchase through links on our site, we may earn an affiliate commission.Here’s how it works.
Although, onWindows 10, you can conveniently sign out, shut down, restart, or hibernate your computer from the Start menu or Lock screen, the system also includes theshutdown.exetool 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 to 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 tocreate a scriptthat involves restarting the computer, or you are making system changes, and you want to record a reason for the restart or shutdown event.
Thisguidewill walk you through how to use the shutdown.exe command-line tool to shut down and restart local and remote computers.
How to turn off computer with shutdown command
To shut down the computer manually with Command Prompt, use these steps:
In the command, replaceTIMEfor 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 5
Once you complete the steps, the computer will execute the shutdown process depending on your specified options.
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.
Shut down specifying reason
To turn off the device recording for a specific reason on Windows 10, use these steps:
In the command, change theMAJOR-NUMBER:MINOR-NUMBERfor the numbers that represent the reason. You can determine all the available major and minor reason numbers by running theshutdown /?command. For example, this command shuts down the device, recording the “Operating System: Service pack (Planned)” reason:shutdown /s /t 1 /d p:2:16.You can also switch the/sfor the/roption if you want to specify a reason for the restart in the command. Here’s how:shutdown /r /t 1 /d p:2:16
The 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 inEvent Viewer>Windows Logs>Systemand look for the “Information” event with theUser32source and with the “Event ID” of1074.
Shut down with custom dialog message
To shut down a computer showing a dialog message alerting the user of the action, use these steps:
In the command, replaceTIMEwith the number of seconds before shutting down the computer, and replaceMESSAGEwith 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/sfor the/roption 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.”
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 remotely turn off or restart a device. However, the tool is limited, and you will perform 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 afull backup of your computerbefore proceeding.
After you complete the steps, the device will be open to receive commands remotely from authenticated users.
If you want to revert the changes to improve the device security, you can use the same instructions outlined above, but instep 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:
In the command, replaceREMOTE-PCwith the name or IP address of the remote computer. For example, this command connects to the computer:net use \10.1.4.120\ipc$
In the command, replaceREMOTE-PCfor the name or IP address of the remote computer,TIMEfor the number of seconds to wait before beginning the shutdown process, and replaceCOMMENTfor the custom dialog you want to send 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 /t60 /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’s an example:shutdown /r /m \10.1.4.120 /t 0 /f
Once you complete the steps, the remote host will power off according to the command configuration.
If you want to disconnect from theIPC$share, run the following command:“net use * /delete”(without quotations) and pressYto 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:
In the command, replaceTIMEfor the second to wait before the device begins the restart process. For example, this command restarts the computer after five seconds:shutdown /r /t 5
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 of 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:
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:
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 toenable 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:
Alternatively, you can also use the/pinstead of the/soption 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:
Alternatively, you can also use the/pinstead of the/soption to close all running applications and force the shutdown without warning.
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.
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:
In the command, replaceREMOTE-PCwith the name or IP address of the remote computer. For example, this command aborts the shutdown action on the remote computer:shutdown /a /m \10.1.4.120
In these steps, it is assumed you successfully ran the shutdown command, meaning you did 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/oand/hybridoptions are available starting on Windows 8.
More resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
Cutting-edge operating system
A refreshed design in Windows 11 enables you to do what you want effortlessly and safely, with biometric logins for encrypted authentication and advanced antivirus defenses.
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.