bat-fil: @ECHO off
title Shutdowntimer [On/Off]
REM Avstängningstimer av Save på SweClockers.com
:start
cls
ECHO.
ECHO.
ECHO [Shutdown/Reboot-timer]
ECHO.
ECHO Current time is:
time /T
ECHO.
ECHO Shutdown-timer: Reboot-timer:
ECHO 1. = 1 hour Q. = 1 hour
ECHO 2. = 2 hours W. = 2 hours
ECHO 3. = 3 hours E. = 3 hours
ECHO 4. = 4 hours R. = 4 hours
ECHO 5. = 5 hours T. = 5 hours
ECHO 6. = 6 hours Y. = 6 hours
ECHO.
ECHO 0. Stop timer (applies to all)
ECHO.
ECHO.
ECHO Set timer by typing a value from the list above, then press [ENTER]
set choice=
set /p choice=Choice:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto 1
if '%choice%'=='2' goto 2
if '%choice%'=='3' goto 3
if '%choice%'=='4' goto 4
if '%choice%'=='5' goto 5
if '%choice%'=='6' goto 6
if '%choice%'=='q' goto Q
if '%choice%'=='w' goto W
if '%choice%'=='e' goto E
if '%choice%'=='r' goto R
if '%choice%'=='t' goto T
if '%choice%'=='y' goto Y
if '%choice%'=='Q' goto Q
if '%choice%'=='W' goto W
if '%choice%'=='E' goto E
if '%choice%'=='R' goto R
if '%choice%'=='T' goto T
if '%choice%'=='Y' goto Y
if '%choice%'=='0' goto 0
cls
ECHO "%choice%" The given command doesnt exist, re-running BATch.
ECHO.
goto start
:1
cls
ECHO.
ECHO Shutdowntimer (1 hour) started.
shutdown -s -t 3600 -f -c "Shutdown issued by user from BATch-file (1 hour), remember to save your work before shutdown strikes."
goto end
:2
cls
ECHO.
ECHO Shutdowntimer (2 hours) started.
shutdown -s -t 7200 -f -c "Shutdown issued by user from BATch-file (2 hours), remember to save your work before shutdown strikes."
goto end
:3
cls
ECHO.
ECHO Shutdowntimer (3 hours) started.
shutdown -s -t 10800 -f -c "Shutdown issued by user from BATch-file (3 hours), remember to save your work before shutdown strikes."
goto end
:4
cls
ECHO.
ECHO Shutdowntimer (4 hours) started.
shutdown -s -t 14400 -f -c "Shutdown issued by user from BATch-file (4 hours), remember to save your work before shutdown strikes."
goto end
:5
cls
ECHO.
ECHO Shutdowntimer (5 hours) started.
shutdown -s -t 18000 -f -c "Shutdown issued by user from BATch-file (5 hours), remember to save your work before shutdown strikes."
goto end
:6
cls
ECHO.
ECHO Shutdowntimer (6 hours) started.
shutdown -s -t 21600 -f -c "Shutdown issued by user from BATch-file (6 hours), remember to save your work before shutdown strikes."
goto end
:Q
cls
ECHO.
ECHO Reboot-timer (1 hour) started.
shutdown -r -t 3600 -f -c "Restart issued by user from BATch-file (1 hour), remember to save your work before restart strikes."
goto end
:W
cls
ECHO.
ECHO Reboot-timer (2 hours) started.
shutdown -r -t 7200 -f -c "Restart issued by user from BATch-file (2 hours), remember to save your work before restart strikes."
goto end
:E
cls
ECHO.
ECHO Reboot-timer (3 hours) started.
shutdown -r -t 10800 -f -c "Restart issued by user from BATch-file (3 hours), remember to save your work before restart strikes."
goto end
:R
cls
ECHO.
ECHO Reboot-timer (4 hours) started.
shutdown -r -t 14400 -f -c "Restart issued by user from BATch-file (4 hours), remember to save your work before restart strikes."
goto end
:T
cls
ECHO.
ECHO Reboot-timer (5 hours) started.
shutdown -r -t 18000 -f -c "Restart issued by user from BATch-file (5 hours), remember to save your work before restart strikes."
goto end
:Y
cls
ECHO.
ECHO Reboot-timer (6 hours) started.
shutdown -r -t 21600 -f -c "Restart issued by user from BATch-file (6 hours), remember to save your work before restart strikes."
goto end
:0
cls
ECHO.
ECHO Shutdown terminated.
shutdown -a
goto end
:end
ECHO.
ECHO Are you happy with your settings?
ECHO [1/Y = Yes]
ECHO [2/N = No ]
set choice=
set /p choice=Choice:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto close
if '%choice%'=='2' goto start
if '%choice%'=='y' goto close
if '%choice%'=='n' goto start
if '%choice%'=='Y' goto close
if '%choice%'=='N' goto start
cls
ECHO "%choice%" The given command doesnt exist, use 1/Y or 2/N to command.
ECHO.
goto end
:close
exit