When m key pressed, goto
Posted: 06 Mar 2010 13:36
I really want a script that when you press the m key, it goes to a certain place in the BAT script.
Code: Select all
@echo off &setlocal
:menu
set "password="
set /p "password=Enter your password: "
cls
if "%password%"=="password" (
set /a n=0
goto loop
)
goto menu
:loop
echo.
echo You logged in successfully.
echo This is loop %n%.
set /a n+=1
echo.
REM old choice.exe:
:: choice /n /c:lm "(l)oop again, show (m)enu: "
REM new choice.exe:
choice /n /c "lm" /m "(l)oop again, show (m)enu: "
set /a x_diff=0
cls
if errorlevel 2 goto menu
goto loop