I wanted to have something that will make my PC shutdown after given time. I also wanted to keep it as simple as possible, no fancy programs with a lot of options that can be found on internet. So i came up with this batch file. I'm sharing it in case someone would like to use it.
What it does?
It's using window's shutdown program to set amount of time (minutes) after which windows will shutdown itself. You run it, type number of minutes after which you want your PC to shutdown and hit enter. In order to cancel shutdown just run it again.
How to use it?
Just open notepad or any text editor, copy and paste code below into it and save file as "whateveryouwant.bat". Basically anything with .bat extension. Now you can simply run the .bat file by double clicking.
Code:
@ECHO OFF
shutdown /a 2>NUL
IF errorlevel 1 GOTO WYLACZ
GOTO KONIEC
:WYLACZ
SET wylacz=
SET /P wylacz=Shutdown after the number of minutes:
SET /A wylacz*=60
shutdown /s /t %wylacz%
SET wylacz=
:KONIEC
ECHO ON