Automate Windows Shutdown from the Command Line
Shutdown is a command-line utility for shutting down, logging off, turning off, or restarting a Windows computer. There is no user interface -- when you run Shutdown, it immediately executes the command you pass on the command line. This makes it an ideal companion for login scripts, batch files, and any automated workflow where you need to control the power state of a machine without user interaction.
The program is extremely easy to use and distribute. No installation is required -- just copy the single executable to wherever you need it and call it from your scripts. By default, running Shutdown with no arguments will simply shut down Windows. With command-line options, you can log off the current user, power off the machine (if supported by the hardware), or restart the computer. Shutdown pairs nicely with Message Manager Deluxe for login script automation, letting you display a message to the user before performing the shutdown action.
Shutdown also supports a FORCE option that terminates unresponsive applications immediately instead of waiting for the user to respond to "application not responding" dialog boxes. This is especially useful in unattended scenarios where no one is present to click through confirmation prompts.
Who Is This For?
- IT administrators -- Automate shutdowns and restarts via login scripts, Group Policy, or scheduled tasks across your network.
- System administrators -- Force shutdown or restart unresponsive machines without waiting for hung applications to respond.
- Script writers -- Integrate shutdown, restart, and logoff commands into batch files and automation workflows with a single executable.
- Network administrators -- Control machine power states across the network using login scripts and remote management tools.
Key Features
Multiple Actions
Shutdown, log off, power off, or restart Windows with a single command. Choose the exact power action you need by passing a simple numeric argument.
Force Mode
Force unresponsive applications to close immediately instead of waiting for user input. Eliminates "application not responding" dialog boxes in unattended scenarios.
No User Interface
Executes instantly with no window, no dialog, and no interaction needed. The command runs and completes without any visible output or prompts.
Script Friendly
Drop Shutdown into any batch file, login script, scheduled task, or Group Policy startup sequence. Works anywhere a command-line executable can run.
Self-Closing
Completes the requested action and exits automatically. No process left running, no memory consumed, and no cleanup needed after execution.
Command Line Options
Usage:
SHUTDOWN.EXE {command} {FORCE}
Pass the option you wish to perform on the command line:
1 -- Shut down Windows safely. Flushes all file buffers to disk and stops all running processes.
2 -- Log off the current user. Shuts down all processes and ends the user session.
3 -- Shut down and power off. Requires hardware support for power-off capability.
4 -- Shut down and restart the computer.
FORCE -- Forces applications to close without prompting the user. Instead of displaying the "application not responding" dialog box, this option terminates all applications immediately.
Examples:
shutdown.exe 4
Restart the computer.
shutdown.exe 4 FORCE
Restart the computer, forcing all applications to close immediately.
shutdown.exe 2
Log off the current user.
Windows Compatibility
Win 11
Win 10
Win 8
Win 7
Vista
XP
Win 2k
NT
ME
98
95