Force Shutdown or Restart from Command Line
If you’ve been using the power button to force shutdown your PC, try this Command Line trick to Force Shutdown and to Force Restart your PC. This Command Line trick allows you to specify normal Shutdown/Restart or if you want to Force Shutdown/Restart and also allows you to specify the time to wait before Force Shutdown/Restart. Shutdown.exe is the process responsible for System Shutdown and Restart. Normal Shutdown is the term we’ve used here to mention the default Shutdown. Force Shutdown will stop all processes and forcefully shuts down your PC. Force Shutdown with time set as a parameter, will force shutdown your PC at the specified time. The same goes for Restart and Force Restart except for the base parameter (-r instead of -s)
To perform a normal Shutdown, open Run (Start >> Run) and type in Shutdown –s . Your PC will shutdown just as it would when you click Shutdown from the Start menu
To perform a Force Shutdown, type in Shutdown –s –f. Notice a new parameter –f? This parameter is responsible for Fore Shutdown.
Force Shutdown with Time
To perform a Timed Force Shutdown, type in Shutdown –s –f –t 00. This will Force Shutdown your PC in 00 seconds (waiting time). Setting it to 05 will shutdown your PC after 05 seconds i.e after waiting for 5 seconds.
To restart, simply replace –s with –r. If you are unsure, proceed reading.
To perform a normal Restart, open Run (Start >> Run) and type in Shutdown –r . Your PC will reboot just as it would when you click Restart from the Start menu
To perform a Force Restart, type in Shutdown –r –f.
Force Restart with Time
To perform a Timed Force Restart, type in Shutdown –r –f –t 00.
Read Command Line Parameters to try more commands.