So I just got into batch and I wanted to create a list where a person could choose which option to view.
Down below is what I've done so far and obviously didn't work.
What I really hate is that pressing 1 to access the first menu and then again 1 to access the other one totally works, but if you try going back and press 2 it just closes.
I should mention I wanted to add an option in all of the categories to press 1 and it brings you back, in the main menu 5 stands for leave.
Hope you guys can understand the issue. Thanks.
@ Echo off
:a
echo Welcome. Please select the needed option to continue.
ECHO 1.
ECHO 2.
ECHO 3.
ECHO 4.
ECHO 5.
set /p menu=
if %menu%==1 (
:b
ECHO 1.
ECHO 2.
ECHO 3.
ECHO 4.
ECHO 5.
ECHO 6.
ECHO 7. Go Back
set /p menu1=
)
if %menu1%==1 (
ECHO 1
set /p I=
)
if %I%==1 (
goto b
)
if %menu1%==2 (
ECHO 2
set /p II=
)
if %II%==1 (
goto b
)
if %menu1%==3 (
set /p III=
ECHO 3
if %III%==1 (
goto b
)
)
if %menu1%==4 (
set /p IV=
ECHO 4
if %IV%==1 (
goto b
)
)
if %menu1%==5 (
set /p V=
ECHO 5
if %V%==1 (
goto b
)
)
if %menu1%==6 (
set /p VI=
ECHO 6
if %VI%==1 (
goto b
)
)
if %menu1%==7 (
goto a
)
)
if %menu%==2 (
ECHO 1.2
set /p menu2=
)
if %menu2%==1 (
goto a
)
)
if %menu%==3 (
set /p menu3=
ECHO 1.3
if %menu3%==1 (
goto a
)
)
if %menu%==4 (
set /p menu4=
ECHO 1.4
if %menu4%==1 (
goto a
)
)
if %menu%==5 (
ECHO Logging Off...
clr
)