The Windows Shutdown Command: Every Switch With Examples

Type shutdown /s /t 0 in Command Prompt, PowerShell or the Run box (Windows key + R) to shut Windows down immediately. shutdown /r /t 0 restarts the PC, and shutdown /a cancels a shutdown that is counting down. The /t value sets a delay in seconds, /f closes running apps without asking, and /m \\PCNAME targets another computer on the network.
shutdown.exe is built into every version of Windows 11 and Windows 10. The switch table below follows Microsoft's shutdown command reference.

Quick examples you can copy
| Task | Command |
|---|---|
| Shut down now (full shutdown, no Fast Startup) | shutdown /s /t 0 |
| Restart now | shutdown /r /t 0 |
| Shut down in 1 hour | shutdown /s /t 3600 |
| Cancel a pending shutdown | shutdown /a |
| Sign out | shutdown /l |
| Hibernate | shutdown /h |
| Restart into advanced startup | shutdown /r /o /t 0 |
| Restart into UEFI firmware settings | shutdown /r /fw /t 0 |
| Restart a remote PC in 60 seconds | shutdown /r /m \\PCNAME /t 60 /c "Maintenance" |
All shutdown switches
| Switch | What it does |
|---|---|
| /s | Shuts down the computer |
| /r | Restarts the computer |
| /sg | Shuts down; on the next start, signs in and restarts registered apps if Automatic Restart Sign-On is enabled |
| /g | Restarts and restarts registered apps, like /sg |
| /l | Signs out the current user immediately |
| /h | Hibernates the local computer, if hibernation is enabled |
| /hybrid | Shuts down and prepares Fast Startup; use with /s |
| /p | Turns off the local computer immediately, without delay or warning |
| /a | Aborts a pending shutdown or restart during the time-out |
| /o | Restarts into the Advanced boot options menu; use with /r |
| /fw | Makes the next restart open the UEFI firmware settings; combine with a shutdown option |
| /f | Forces running apps to close without warning; implied when /t is greater than 0 |
| /t xxx | Delay in seconds before the action; default 30, maximum 315360000 (10 years) |
| /m \\computer | Targets a remote computer |
| /c "comment" | Adds a reason message of up to 512 characters, shown to signed-in users |
| /d p:xx:yy | Records a planned (p) or user-defined (u) reason code |
| /e | Documents an unexpected shutdown in the Shutdown Event Tracker |
| /i | Opens the Remote Shutdown dialog; must be the first switch |
Run shutdown /? to see the full help on your PC. Windows also accepts a dash instead of the slash, for example shutdown -s -t 0.
Schedule a shutdown with a timer
Add /t with the delay in seconds: shutdown /s /t 1800 shuts the PC down in 30 minutes, shutdown /s /t 7200 in two hours. Windows shows a notification with the scheduled time. Because /f is implied with any delay above 0, open apps are closed without a save prompt when the timer runs out, so save your work first.
For a shutdown at a fixed time every day, create a task in Task Scheduler that runs shutdown.exe with the arguments /s /t 60.
Cancel a scheduled shutdown
Run shutdown /a before the timer runs out. It works for shutdowns started with the command and for most system-initiated restarts that are still counting down.
Restart into advanced startup or firmware settings
shutdown /r /o /t 0 restarts directly into the blue Advanced startup menu, where you find Startup Settings (Safe Mode), System Restore and Command Prompt. shutdown /r /fw /t 0 restarts straight into the UEFI firmware settings, which helps on PCs where the BIOS key is hard to hit during boot.
Shut down a remote PC
To shut down or restart another computer on the network, use /m with the computer name: shutdown /r /m \\OFFICE-PC /t 60 /c "Restarting for updates". You need administrator rights on the remote PC, and remote shutdown must be allowed through its firewall. shutdown /i opens a dialog that lets you pick several computers and a reason.

Create a shutdown shortcut or batch file
A desktop shortcut runs a shutdown command with a double-click:
- Right-click the desktop and select New > Shortcut.
- Enter the command as the location, for example
shutdown /s /t 0. - Name the shortcut and click Finish. Change its icon under Properties if you like.

A batch file does the same and can combine several commands. Create a text file with the command, save it with the extension .bat and double-click it to run it.

shutdown vs PowerShell Stop-Computer
PowerShell has its own commands: Stop-Computer shuts down and Restart-Computer restarts, with -Force to close apps and -ComputerName for remote PCs. They are handy in scripts, but shutdown.exe works in both Command Prompt and PowerShell and supports timers and the advanced startup switches.
Common errors and fixes
- "Access is denied (5)" on a remote PC: run the command as an administrator account that also has rights on the target computer.
- "The entered computer name is not valid or remote shutdown is not supported on the target computer": check the name, network discovery and the firewall rule for remote shutdown on the target.
- "A system shutdown is in progress (1115)": a shutdown is already scheduled; run shutdown /a first.
FAQ
Does shutdown /s install pending updates?
Windows installs pending updates during a normal shutdown or restart, including one started with the command. Use the Start menu option "Shut down" without updates when Windows offers it if you want to postpone them.
What does shutdown /hybrid do?
It shuts down and saves the system state for Fast Startup, the same as the default Start menu shutdown on most PCs.
How do I do a full shutdown without Fast Startup?
shutdown /s /t 0 already performs a full shutdown, because Fast Startup is only used when you add /hybrid. Holding Shift while clicking Shut down in the Start menu does the same.
What is the longest timer I can set?
315,360,000 seconds, which is ten years.
Related: how to enable the Ultimate Performance plan in Windows 11, the Windows 11 Media Creation Tool and how to upgrade with the Windows 11 Installation Assistant.
Hi,
am looking for below information.
I have a scenario, where in after the windows feature update is download and installed, I see a option called” RESTART” under Update & Security page.
I need the command which I initiates above RESTART, where in updates will start applying.
Thanks
can some one help me, i want my pc to shutdown at 6pm and it alert some comment 5 min before shutdown.
It seems that shutdown /a only works during the timeout delay. Once the shut-down starts, running shutdown /a gives the error shutdown.exe failed to start because the system is shutting down. How do I abort the shut down after the shut-down starts?
The Sleep command though is a little tricky for Windows 8 and higher. If you have disabled Hibernation, you can try:
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
If Hibernation is enabled, this command will send the PC to Hibernation or might not even work at all even with HB. disabled. In this case, your best alternative would be the PsShutdown command by Sysinternals: https://technet.microsoft.com/en-us/sysinternals/psshutdown
psshutdown.exe -d -t 0 -accepteula
This will send the PC to Sleep for sure and is probably the best way to use for all cases.
Forgot to mention: even PsShutdown might fail to work. Blame Microsoft for requiring Admin rights for anything to work. In this case, you will just have to create a shortcut to psshutdown.exe, including all parameters in above message in the Target properties, and use this shortcut as your command instead.
You should right-click the shortcut to enter Properties/Shortcut/Advanced and tick “Run as administrator”.
Thanks Martin for this interesting topic.
Before closing Win 10 64-bit, I run a batch file (I resume it):
Restore Firefox 32-bit in these 3 directories by default as I use the last time
Restore Cyberfox 32-bit in these 3 directories by default as I use the last time
shutdown -s -f -t 5
Here’s another utility to shutdown your computer:
DShutdown v1.73.2
http://dimio.altervista.org/eng/
Have good day!
Robert G.
I prefer to use PowerShell cmdlets: Stop-Computer, Suspend-computer and restart-computer.
In Windows 10, don’t use a : after the t-parameter. It is there just “/t 0”. :)
If you want to get a really fast shutdown, try:
C:\Windows\System32\cmd.exe /c start “Shutdown” /high C:\Windows\System32\shutdown.exe /s /f /t 0