I've made a simple program like this in C# before as an exercise. I'm doing it now as a .bat script. So... What am i doing wrong?:
@echo off
title TimedShutdown
color 02
mode con:cols=50 lines=5
:start
cls
set "quit=a"
set /p Minutes= Minutes to shutdown? ('a'= cancel shutdown) -
if %Minutes%==%quit% (shutdown /a
pause goto start)
set "Seconds=%Minutes%*60"
shutdown /s /t %Seconds%
pause
goto Loop
:Loop
cls
set /a Seconds=%Seconds%-1
set /a Minutes=%Seconds%/60
set /a Remainder=%Seconds% %% 60
echo %Minutes%m %Remainder%s remaining...
timeout 1 >nul
goto Loop
As you can see this isn't a very complicated script so I'm sure you people don't need an explanation on what it does. It seems to work just fine, except that the shutdown command part itself doesn't seem to work. I threw in a pause command after it to see what went wrong and I see this. What on earth does that mean!?
&
between commands on one line: pause & goto start)
/a
: set /a Seconds=%Minutes% * 60
@echo off