Automatically shutting down your Windows PC can be quite handy in specific situations. Imagine your computer sitting idle for long periods after tasks like installing updates, downloading files, rendering videos, or even while you’re catching up on a series before bedtime.
However, running your computer for extended periods can lead to unnecessary energy consumption. In such cases, you can set up your computer to shut down automatically after a certain period. If you’re not around to do it manually, the system takes care of it for you.
You can even schedule your computer to perform an automatic restart, all by using the Windows Command Prompt (cmd.exe). This tool is built into your system and allows you to create new commands. The best part is that you don’t need to be a coding expert to use this feature. Let’s walk through the process in the following steps!
How to Automatically Shut Down a Windows PC
- Press the “Windows” key;
- Search for “cmd” in the search bar;
- Open the Command Prompt (cmd.exe);
- Once that’s done, you can type the command “shutdown -s -t” to set a time to shut down your computer;
- To set 30 minutes, for example, the command counts numbers in seconds so that it would be 1800 (30 times 60 seconds).
- This way, the complete command would be “shutdown -s -t 1800”;
- Then, just hit the “Enter” key.
Understanding the command
- “shutdown” is the command itself; it “orders” the machine to shut down;
- “-s” (from “shutdown” in English) is the option to turn off the machine (do not restart or hibernate);
- “-t” (from “time” in English) is the option that enables the timer that starts the countdown;
- “1800” is the time in seconds, equivalent to 30 minutes;
How to Restart Windows Automatically
- Access the Command Prompt (cmd.exe);
- Then type the command “shutdown -r -t” to set a time to restart your computer;
- Then, following the same logic as the other command to set the time to 30 minutes, enter the number 1800 (time in seconds);
- The complete command would be “shutdown -r -t 1800”;
- Then just hit the “Enter” key.
Understanding the command
- -r (“reset” in English) is the option to restart the machine within the command.
Can I undo the programming?
Yes. With the Command Prompt (cmd.exe) open, you can cancel the schedule by typing the command “shutdown -a” (“abort”, in English). This command cancels any previous schedule (either to shut down or restart). All of these features are available across operating systems, starting with Windows 7 (or higher) version.
It is worth noting that all commands can be canceled with “shutdown -a”, and it is possible to combine several of them as long as they do not conflict (tell the machine to shut down and restart simultaneously). Did you like this article? Share this tip with your friends!