choice.exe
allow a cmd.exe
batch file to present a list of options from which a user can choose from. %errorlevel%
and different actions can be taken using an if
statement. choice /c rgb /M "Choose [r]ed, [g]reen or [b]lue" if %errorlevel% equ 1 ( echo Tomato ) else if %errorlevel% equ 2 ( echo Peas ) else ( echo Grapes )
/t
option is also used in timout.exe
for time out.