CHOICE.exe – Windows CMD Command

Accept user input to a batch file. Choice allows single key-presses to be captured from the keyboard.

ERRORLEVEL will return the numerical offset of choice keys.
Choice.exe is a standard command in Windows 2003 and greater, it was first made available in the Windows XP resource kit.

CHOICE can be used to set a specific %errorlevel%
for example to set the %errorlevel% to 6 :
ECHO 6| CHOICE /C 123456 /N >NUL

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *