[Resolved] Alternative xcopy function to Choice - Carriage return as accepted character possible?
Posted: 18 Sep 2019 00:44
I came across this superb script by by aGerman which is a functional replacement to the choice command using xcopy behind the scenes, executing the conditional errorlevel commands only if the character input matches a predefined list (like choice /n). Was ideal as I was looking for something that didn't beep on invalid inputs as choice does.
Wasn't sure of forum etiquette of necro'ing topics so decided to make a new topic, hope no one minds.
What I was wondering is whether the Enter key/carriage return could be defined as a valid input character along with the other valid 'choices' characters, as I was hoping for a way to define a default command to execute if the prompt is 'skipped' by pressing Enter. The other non-choice-like set /p prompts in my script I made to behave in this manner to quickly apply defaults (in those prompts I have it conditionally apply commands if nothing was entered).
Wasn't sure of forum etiquette of necro'ing topics so decided to make a new topic, hope no one minds.