Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
3,907,020,582 visitors served.
forum Join the Word of the Day Mailing List For webmasters
?
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

DOS Choice

    0.01 sec.
DOS Choice
An external command starting with DOS 6 that is used to provide user interaction in a batch file. It lets you ask a question and obtain a single character as an answer.

For example, if you create a batch file to do three things, you can use Choice to ask which one. Examine the following:
       choice /c:abc  /n  Do you want A, B or C?
       if errorlevel 3 goto thingc
       if errorlevel 2 goto thingb
       "do thing A here"

       :thingb
       "do thing B here"

       :thingc
       "do thing C here"


The choices follow the /c: switch. The answers are stored in the error level (A in 1, B in 2, etc.), which is then tested. If any other character is entered, the computer beeps and waits.

The /n suppresses the message that would be displayed following your prompt. In the above case, it would be [A,B,C]?

Note that the error levels must be tested from high to low order. The CHOICE.COM file provides this functionality.


Want to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit the webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Feedback
Mentioned in?   Encyclopedia browser?   Full browser?
No references found
 
 
 
Encyclopedia
?

Terms of Use | Privacy policy | Feedback | Advertise with Us | Copyright © 2012 Farlex, Inc.
Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.