How to make "multiple choise" batch files

HI,
I have been tried to make Multiple Choice batch file
in w2000. CHOICE is not recognized as an internal or external command. Where I can find (working) Multiple batch examples or does anyone know how to do these in W2K.

@ECHO OFF

:BEGIN
CLS

CHOICE /N /C:123 PICK A NUMBER (1, 2, or 3)%1

IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END
:THREE
ECHO Hello World
GOTO END
:TWO
ECHO Hello World 2
GOTO END
:ONE
ECHO Hello World 1
:END


<P ID="edit"><FONT SIZE=-1><EM>Edited by savoc on 01/09/03 07:42 AM.</EM></FONT></P>
2 answers Last reply
More about make multiple choise batch files
  1. use the set /p command like so:
    <pre>set /p RESP=Which one?
    echo Response: %RESP%
    </pre><p>Try it out for yourself.

    <i>It's always the one thing you never suspected.</i>
  2. Thaks, "SET" really works.

    @echo off
    echo.
    echo Pick one:
    echo.
    echo 1. Apple
    echo 2. Orange
    echo 3. Potato
    echo 4. Banana
    echo 5. Tomato
    echo 6. Melon
    echo 7. EXIT
    echo.
    :choice
    Echo Hit a number [1-7] and press enter.
    set /P CH=[1-7]
    if "%CH%"=="1" goto apple
    if "%CH%"=="2" goto orange
    if "%CH%"=="3" goto potato
    if "%CH%"=="4" goto banana
    if "%CH%"=="5" goto tomato
    if "%CH%"=="6" goto melon
    if "%CH%"=="7" goto quit
    ...
Ask a new question

Read More

Font Command Prompt Windows