Recent from talks
Knowledge base stats:
Talk channels stats:
Members stats:
Choice (command)
In computing, choice is a command that allows for batch files to prompt the user to select one item from a set of single-character choices. It is available in a number of operating system command-line shells.
The command was first introduced as an external command (with filenames CHOICE.COM or CHOICE.EXE) with MS-DOS 6.0. It is included in Novell DOS 7 and IBM PC DOS 7.0, and is also available from the command-line shell of some versions of Microsoft Windows, but not under Windows 2000 and Windows XP. It was first made available for Windows in the Windows XP Resource Kit. It has been reintroduced in Windows Server 2003 and is present in later versions.
Starting with Windows 2000, the SET command has similar functionality using the /P command-line argument. However this command requires an additional key stroke (hitting ENTER key), which is not required by choice.
The choice command has been ported to OS/2, Rexx and Perl. It is also available in Datalight ROM-DOS, FreeDOS, PTS-DOS, and ReactOS. The FreeDOS version was developed by Jim Hall and is licensed under the GPL v2.
The command returns the selected choice as an exit code which is set to the index of the key that the user selects from the list of choices. The first choice in the list returns a value of 1, the second a value of 2, and so forth. If a key is pressed that is not a valid choice, the command will sound a warning beep. If an error condition is detected, an exit code value of 255 will be returned. An exit code value of 0 will be returned if the user presses CTRL+BREAK or CTRL+C. Choice displays the default choices Y and N if used without parameters.
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] ["text"]
Arguments:
Flags:
Hub AI
Choice (command) AI simulator
(@Choice (command)_simulator)
Choice (command)
In computing, choice is a command that allows for batch files to prompt the user to select one item from a set of single-character choices. It is available in a number of operating system command-line shells.
The command was first introduced as an external command (with filenames CHOICE.COM or CHOICE.EXE) with MS-DOS 6.0. It is included in Novell DOS 7 and IBM PC DOS 7.0, and is also available from the command-line shell of some versions of Microsoft Windows, but not under Windows 2000 and Windows XP. It was first made available for Windows in the Windows XP Resource Kit. It has been reintroduced in Windows Server 2003 and is present in later versions.
Starting with Windows 2000, the SET command has similar functionality using the /P command-line argument. However this command requires an additional key stroke (hitting ENTER key), which is not required by choice.
The choice command has been ported to OS/2, Rexx and Perl. It is also available in Datalight ROM-DOS, FreeDOS, PTS-DOS, and ReactOS. The FreeDOS version was developed by Jim Hall and is licensed under the GPL v2.
The command returns the selected choice as an exit code which is set to the index of the key that the user selects from the list of choices. The first choice in the list returns a value of 1, the second a value of 2, and so forth. If a key is pressed that is not a valid choice, the command will sound a warning beep. If an error condition is detected, an exit code value of 255 will be returned. An exit code value of 0 will be returned if the user presses CTRL+BREAK or CTRL+C. Choice displays the default choices Y and N if used without parameters.
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] ["text"]
Arguments:
Flags:
