Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,795,480,521 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

DOS Choice

    0.02 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.



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

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
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. Terms of Use.