How to Shutdown or Restart Windows from Command Line

Printer-friendly versionPDF version
How to Shutdown or Restart Windows from Command Line

You can use the "shutdown" command to shutdown or restart a Windows Operating System from the command line. This command works from a regular command prompt or from PowerShell. Here are the commands needed:

To shutdown: shutdown -s -f

To restart: shutdown -r -f

Here are a few useful notes on some of the options:

-f forces all applications to close. This is optional, but will keep hung applications from holding up the shutdown/reboot process (epecially useful for terminal services)

-t is used to wait X number of seconds before shutdown/reboot. For example, "-t 0" will start the process right away, while "-t 100" will wait 100 secons.

Post new comment