tldr/pages/windows/choice.md

29 lines
713 B
Markdown
Raw Normal View History

2020-10-19 16:38:32 +01:00
# choice
> Prompt user to select a choice and return the selected choice index.
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/choice>.
2020-10-19 16:38:32 +01:00
- Prompt the current user to select a `Y` or `N` choice:
2020-10-19 16:38:32 +01:00
`choice`
2020-10-19 16:38:32 +01:00
- Prompt the current user to select a [c]hoice from a specific set:
2020-10-19 16:38:32 +01:00
`choice /c {{AB}}`
2020-10-19 16:38:32 +01:00
- Prompt the current user to select a choice with a specific [m]essage:
2020-10-19 16:38:32 +01:00
`choice /m "{{message}}"`
2020-10-19 16:38:32 +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
`choice /cs /c {{Ab}}`
2020-10-19 16:38:32 +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
`choice /t {{5}} /d {{N}}`
2020-10-19 16:38:32 +01:00
- Display help:
2020-10-19 16:38:32 +01:00
`choice /?`