5-8 Utility Descriptions
If the text argument is added
CHOICE /c:ync Please select Yes, No, or Continue
the display will be:
Please select Yes, No, or Continue [Y,N,C]?
If the key choice prompt is left off
CHOICE /n Continue reading file
only the following appears (note key choice of YN is default)
Continue reading file?
A complete batch file example follows. Each prompt selection returns an
errorlevel that can be trapped. The errorlevel corresponds to the order of
the key choice. For example, with /c:teo, t returns 1, e returns 2, and o
returns 3.
@echo off
cls
echo.
echo T Run TIME-IN Program
echo E Run Employee Update
echo O Run TIME-OUT Program
echo.
c:\dos\choice /teo /t:t,5 Please select option
if errorlevel 3 goto timeout
if errorlevel 2 goto update
if errorlevel 1 goto timein