DOS Choice Command: Complete Guide
In Windows systems, the choice command is used to allow users to make selections among multiple options. Below is the basic syntax and usage of the choice command.
choice [/c choices] [/n] [/cs] [/t timeout /d choice] [/m text]
- The /c choices command specifies a list of available options, for example /c AB means that the user can choose between A or B.
- /n: Specify to not display prompts, only display available options.
- /cs: differentiates between uppercase and lowercase.
- Specify a timeout and default option with /t timeout /d choice.
- m text: specifies the text to be displayed.
For example, you can use the following command to prompt the user to choose whether to continue or cancel the operation:
choice /c:YN /m "Do you want to continue?"
This will display the following message and prompt the user to choose either Y or N to proceed or cancel the operation.