CHOICE /C:AB /N > NUL IF ERRORLEVEL=2 GOTO OTHERS IF ERRORLEVEL=1 GOTO 755 GOTO Start
Is this not possible with PE 2.0? Is there a way to do this but with different syntax?
Posted 07 May 2008 - 05:09 PM
CHOICE /C:AB /N > NUL IF ERRORLEVEL=2 GOTO OTHERS IF ERRORLEVEL=1 GOTO 755 GOTO Start
Posted 08 May 2008 - 12:17 AM
@ECHO OFF CLS :LOOP ECHO A. Menu item A ECHO B. Menu item B ECHO C. Menu item C ECHO Q. Quit :: SET /P prompts for input and sets the variable :: to whatever the user types SET Choice= SET /P Choice=Type the letter and press Enter: :: The syntax in the next line extracts the substring :: starting at 0 (the beginning) and 1 character long IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1% ECHO. :: /I makes the IF comparison case-insensitive IF /I '%Choice%'=='A' GOTO ItemA IF /I '%Choice%'=='B' GOTO ItemB IF /I '%Choice%'=='C' GOTO ItemC IF /I '%Choice%'=='Q' GOTO End ECHO "%Choice%" is not valid. Please try again. ECHO. GOTO Loop :ItemA ECHO Insert commands for Item A. GOTO Again :ItemB ECHO Insert commands for Item B. GOTO Again :ItemC ECHO Insert commands for Item C. GOTO Again :Again PAUSE CLS GOTO Loop :End