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.
Can we enter time in 3 or more digits? I mean if we want to shutdown after 2 Hours! then?
The upper limit is 600 (10 minutes), sadly.
Then i try it works with more than 10 minutes :-)
u can put the cmd in bat file and schedule that bat file with the hep windows scheduled task
how about both restart and shutdown setting? is it shutdown -s -r -f?
That doesn’t work. The computer doesn’t remember it after a restart. Also, I doubt why you would want to restart and shutdown?? You could just shut down instead.