Computer and Software Support


DOS Command Choice

Syntax:

CHOICE [/C[:]keys] [/N][/S][/T[:]c,nn] [text]

Purpose: Used to provide a prompt so that a user can make a choice while a batch program is running (new with DOS Version 6).

 

Discussion

This command is used only in batch programs. It is used to display a prompt to the user. The specified prompt is displayed and the program pauses while the user makes a choice from a specified set of keys.

Options

text - Used to specify text to be displayed before the prompt. When text has not been specified, CHOICE will display only the prompt. You must use quote marks around the text if you include a switch character (/) as part of the text.

/C[:]keys - Used to specify the keys that the user can select from when the prompt is displayed. When displayed, the list of key choices will be separated by commas and enclosed in brackets with a question mark at the end. If the /C option is not used, the CHOICE command displays the default key choices of Y and N. The colon [:] is optional.

/N - When the /N option is used the prompt will not be displayed, however the text before the prompt will be displayed and the specified keys will still be valid.

/S - Using the /S option causes CHOICE to be case sensitive to the keys entered by the user at the prompt.

/T[:]c,nn - The /T option can be used to limit the number of seconds the batch program will pause before it defaults to a specified key. The values for the /T switch are:

c - Specifies the default key (character). The key must be one of those specified in the /C switch.

nn - Specifies the length of the pause in seconds (0 to 99).
 

This page is from http://www.easydos.com. I pasted it on my website to avoid possible broken links. For further help with DOS commands, Check easydos.com out.