How can I shut down the PC after specified amount of time?

Create a batch file, and put this code in it after the @echo off line:

shutdown -s -t 1800

The computer will shutdown 30 minutes (1800 seconds) after running the batch file.

To cancel a shutdown initiated by that batch file, you can go to StartRun and type:

shutdown -a

Or put that in its own separate batch file, then run it to cancel a shutdown.

Here are simple steps to shutdown your computer after a specified time without any application!:

  1. Open the Run window (Windows Key+R) or (Start / All Programs / Accessories / Run).
  2. Key shutdown -s -t 1800:

SU215531 example

[1800(can be changed) is the number of seconds after which the computer will turn off.]

  1. Click on OK and your computer will turn off after the specified time (here 30 minutes).

You can change -s for alternatives as below:

options    effect
-l         to log off
-r         to reboot

The original recommendation - TimeComX, is now only found on shared hosting sites and has been discontinued.

Via Lifehacker, this seems to be a worthy alternative (no personal experience):

Switch Off by AiryTec

Several features of note:

  • Schedule shutdowns by CPU usage levels, time, or remotely
  • Power saving calculator
  • Portable use (no install required - some note this version may not work on x64)

enter image description here
(image via developer)