I've just started learning batch files.
Why does this simple script jump to First every time?
Friends who understand it, please help explain it, thanks.
Also, could you introduce how choice return values work?
Why does this simple script jump to First every time?
Friends who understand it, please help explain it, thanks.
Also, could you introduce how choice return values work?
@echo off
:start
choice /C:FSTO /M "First,Second,Third,Out"
if errorlevel 1 goto First
if errorlevel 2 goto Second
if errorlevel 3 goto Third
if errorlevel 4 goto end
:First
echo This is the first line.
goto start
:Second
echo This is the Second line.
goto start
:Third
echo This is the Third line.
goto start
:end
echo bye!
