I'm following a tutorial from the Super User site of the Stack Exchange site network, with the idea of programming the my computer to auto-shut down by passing X
time, after running or double-clicking a .bat
file, instead of using a random program to do this.
As explained in the answer, we first have to create a Batch file (% with%) and inside it add the code below, just after .bat
:
shutdown -s -t 1800
It will shut down the computer after 30 minutes (1800 seconds) after the file has run. To cancel this action, just change the code above by the code below (or create a new file) and run it with the following code:
shutdown -a
Then I created a Batch file and inside it I added the following line of code:
@ECHO OFF shutdown -s -t 1800
But when I run the file, nothing happens. Am I doing something wrong?