Home   MS-DOS Home   A-Z   NS Utilities   Command Syntax

CHOICE

Home >> MS-DOS Reference >> Command Categories >> Directory Management >> CHOICE

Directory Management

Directory Management


Summary
Description
Command Syntax
Comments
Supported DOS versions: MS-DOS 6.0+
How easy to use? Easy
How safe to use? Very safe
How common? Fairly common
Internal or external command? External

Description

Displays a prompt and asks for a single character response

Command Syntax

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

/C specifies the keys that should be allowed for the response. If it is missed out, the keys Y/N will be used.

/N tells CHOICE to leave off the prompt. The prompt is a list of the allowed keys in square brackets followed by a question mark, eg [YN]?

/S tells CHOICE that the input will be case sensitive, that is Y will not be the same as y.

/T waits for nn seconds and then chooses key n

text must be surrounded by quote marks(" ") if it includes a / character.

Comments

When CHOICE gets a key press, it returns an ERRORLEVEL corresponding to each key. For example, with the default Y/N option Y returns error level 1 and N returns error level 2. See ERRORLEVEL for more details on how to process this.
Home Home
MS-DOS MS-DOS Home
A - Z Index A - Z Index

Top of page
Summary
Description
Command Syntax
Comments




Top of page    Home    MS-DOS Home    NS Utilities
Copyright © 2005 Marcus Houlden  |  Copyright and Data Protection

Printed from the NukeSoft MS-DOS Reference. Copyright © 1995 - 2006 Marcus Houlden