How To Set Your Computer To Shut Down Automatically

The easiest way to schedule an automatic shutdown is through the run command.
  1. Click on start button and click on Run on just simply hold the Win key + R
  2. Convert the time after which you want it to shut down into seconds e.g. after 2hours it will be 120
  3. Type “shutdown -s -t xx” (without quotes) and press Enter. xx represents the number of seconds after which you want the shutdown to be executed e. g. shutdown -s -t 120 means that the computer will shut down after 2 minutes (120seconds). You will get a system shutdown dialog box counting down the remaining time with an inactive cancel button. This means by just trying to cancel the shutdown process it won’t work.
  4. In case you want to cancel the shut down process, type “shutdown.exe /a” (without quotes).
  5. To restart a computer from Run, type “shutdown -r -t xx” (without quotes), where still xx represents the number of seconds after which the shutdown and restart will be initiated.
Shutdown.exe has a list of switches associated with it. To see the list, just type cmd on the Run dialog box and hit Enter key to open the cmd.exe window. Type shutdown and press Enter and a list of switches will be displayed.