When m key pressed, goto
Moderator: DosItHelp
-
- Posts: 16
- Joined: 29 Jan 2010 17:19
When m key pressed, goto
I really want a script that when you press the m key, it goes to a certain place in the BAT script.
Re: When m key pressed, goto
Could you explain what you wanna do?
BTW: Is choice.exe available for you?
BTW: Is choice.exe available for you?
-
- Posts: 16
- Joined: 29 Jan 2010 17:19
Re: When m key pressed, goto
@echo off
cls
:menu
echo Hello
if %password%==password (
doing something and looping
if m key pressed goto menu
)
Something like above.
"Is choice.exe available for you?"
Yes, yes it is.
cls
:menu
echo Hello
if %password%==password (
doing something and looping
if m key pressed goto menu
)
Something like above.
"Is choice.exe available for you?"
Yes, yes it is.
Re: When m key pressed, goto
Hmm, try something like that:
Regards
aGerman
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
Regards
aGerman