brian873 Posted January 18, 2005 Share Posted January 18, 2005 Hi,I would like to create a menu with 7 choices in a batch file. I used to use the choice option but in XP sp2 it seems is not available as standard. I do not want to use any 3rd part apps II just want to use standard windows commands.Can anyone of you smart guys help ?Hail hail Link to comment Share on other sites More sharing options...
IcemanND Posted January 18, 2005 Share Posted January 18, 2005 SET /P variable=[promptstring]See help for SET command.The /P switch allows you to set the value of a variable to a line of inputentered by the user. Displays the specified promptString before readingthe line of input. The promptString can be empty. Link to comment Share on other sites More sharing options...
brian873 Posted January 18, 2005 Author Share Posted January 18, 2005 thanks IcemanND.I already have this in the batch ! DOH !I hate it whe things stare you in the face and laugh. hail hail Link to comment Share on other sites More sharing options...
prathapml Posted January 18, 2005 Share Posted January 18, 2005 so requirement is got?What is your final batch-file (with choices) now, brian873 ? Link to comment Share on other sites More sharing options...
brian873 Posted January 18, 2005 Author Share Posted January 18, 2005 prathapml :Here is the menu, it works well for me just nowhail hail@echo off:STARTCLScolor f2echo. echo. 1 - SlipStream SP2echo. 2 - Apply Hotfixesecho. 3 - Make Unattended echo. 4 - Add Registry Etires echo. 5 - Create ISOecho. 6 - The Worksecho. echo. 0 - EXITecho.echo. && set /p MO=Choose your option? if /i "%MO%"=="6" (goto 6)if /i "%MO%"=="5" (goto 5)if /i "%MO%"=="4" (goto 4)if /i "%MO%"=="3" (goto 3)if /i "%MO%"=="2" (goto 2)if /i "%MO%"=="1" (goto 1)if "%MO%"=="0" goto 0) else if /i "%MO%"=="" ( echo. CHOOSE AGAIN (CLSecho.echo. Your selection was invalid. Please try again.echo.pausegoto START)PAUSE:6CLSecho OPTION %MO% takenPauseGOTO FIN:5CLSecho OPTION %MO% takenPauseGOTO FIN:4CLSecho OPTION %MO% takenPauseGOTO FIN:3CLSecho OPTION %MO% takenPauseGOTO FIN:2CLSecho OPTION %MO% takenPauseGOTO FIN:1CLSecho OPTION %MO% takenPauseGOTO FIN:0aecho. OPTION %MO% taken. EXIT the batchPauseGOTO FIN:FIN Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now