Hello, @mohammed-bismillah,
I rather agree with Peter’s post. To that purpose, read also this valuable article :
http://www.catb.org/~esr/faqs/smart-questions.html
Nevertheless, here is a simple solution for your batch file, below, which should clarify a bit how to proceed !
@echo off title Game cls :menu echo. echo. echo Start : 1 echo Help : 2 echo Exit : 3 echo. set menu= set /p menu= if %menu%! == ! goto :EOF if %menu% == 1 goto game if %menu% == 2 goto help if %menu% == 3 goto :EOF :help cls echo. echo. echo Hit the CORRECT number and press ENTER. echo. echo. :game echo. echo. echo What is your name? echo. set name= set /p name= echo. echo Hello %name%! echo. echo. echo. :qt1 echo Who was the FIRST president of the USA? echo. echo Pierre Desperau : 1 echo George Washington : 2 echo. set qt= set /p qt= if %qt%! == ! goto qt1 if %qt% == 1 echo Incorrect & goto qt2 if %qt% == 2 echo Correct ! :qt2 echo. echo Who is the LAST president of the USA? echo. echo Donald Trump : 1 echo Guy Thevenot : 2 echo Emmanuel Macron : 3 echo. set qt= set /p qt= if %qt%! == ! goto qt2 if %qt% == 1 echo Correct ! & goto qt3 if %qt% == 2 echo Incorrect & goto qt3 if %qt% == 3 echo Incorrect :qt3 REM And so on ....Best Regards
guy038
PS :
if you prefer to quit the batch file, with a simple hit on the ENTER key, on each question, just change each line
if %qt%! == ! goto qt##by the line :
if %qt%! == ! goto :EOF