|Maybe interesting to know, but there is a little bug in CHOICE (still) : |
If you press ANY key that is NOT in the list of keys he is waiting for, the time-out feature stops, and the CHOICE command reverts to a simple key-press feature (a key from his list).
Example, do the below command, and press any alfabet-key apart from Y or N, within 5 seconds:
choice /N /C:YN /T:N,5 Press Y or N :
Note you will see the command wait ... forever. What you can do to prevent this, is to include other characters :
choice /N /C:ABCDEFGHYN /T:N,5 Press Y or N :
But, then you need to cover the errorlevels correctly. Also note that whilst covering a lot of keys, some may not be covered against this bug ... but they are less likely to occur.