Yes, Windows has automatic suspend options, but these only work in relation to the computer’s downtime. The questions are always about how long you want it to pass so that the screen turns off, or for the computer to go into sleep state after you stop using it. Do not turn it off and you can not choose an exact and determined time.

This is where this little trick comes in. It is rather a simple command to define the time in seconds that you want it to happen before Windows logs off and shut down your PC. You can run it from the command prompt, from Windows PowerShell, or create a shortcut on the desktop to keep it always on hand. Read on to find out how.

How to Create a Timer to Shut Down Your PC AutomaticallyLet’s say you’re going to leave your computer unattended in a certain amount of time, but you do not want to shut it down right away before you leave because you need Windows to complete some operation in the next few minutes or hours, either to download a file or whatever. With this command you can set the exact amount of time that will pass before the system is completely shut down.

Press the start button and type “system command” or “Windows PowerShell” in the search to use either. At the console type: shutdown -s -t XXXX. The XXXX represent the time in seconds that you want to pass before the shutdown. If you want the computer to shut down in three hours, you would have to type shutdown -t -s 10800 and press enter. If you want to cancel the shutdown, type the command shutdown -a in the terminal.

Create a shortcut for automatic shutdown

If you do not want to use the terminal you can create a shortcut and leave it on the desktop to start the timer with a simple double click on an icon. To do this right click on the desktop and select “New> Shortcut

In the window that appears, type the command shutdown.exe -s -t XXXX. In the example above I created an access to shut down the PC in 60 seconds.

Give a name to your shortcut that is descriptive, you do not want someone to walk clicking there without knowing what that is. When you want to start the timer just double click on the icon that was created on the desktop.

You will see a warning message indicating the time Windows will log off and shut down the computer.