2020-10-19 16:38:32 +01:00
|
|
|
# choice
|
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
> Prompt user to select a choice and return the selected choice index.
|
2020-12-29 11:46:54 +00:00
|
|
|
> More information: <https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/choice>.
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
- Prompt the current user to select a `Y` or `N` choice:
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
`choice`
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
- Prompt the current user to select a [c]hoice from a specific set:
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
`choice /c {{AB}}`
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
- Prompt the current user to select a choice with a specific [m]essage:
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
`choice /m "{{message}}"`
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
- Prompt the current user to select a [c]ase-[s]ensitive [c]hoice from a specific set:
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
`choice /cs /c {{Ab}}`
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
- Prompt the current user to select a choice and prefer the [d]efault choice in a specific [t]ime:
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
`choice /t {{5}} /d {{N}}`
|
2020-10-19 16:38:32 +01:00
|
|
|
|
2022-08-21 08:03:37 +01:00
|
|
|
- Display help:
|
2020-10-19 16:38:32 +01:00
|
|
|
|
|
|
|
`choice /?`
|