Probably already solved, how to set a default answer in menu? User should just hit enter to carry on (if he agree) or type what he wants, overriding the offered answer, and press enter.
Of course, no choice support...
Thanks
Menu question
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: Menu question
Edit: Read next post.
Last edited by orange_batch on 25 May 2011 07:36, edited 1 time in total.
Re: Menu question
Actually there is a simpler solution - the value of choice remains unchanged if <Enter> is pressed without entering anything:
Dave Benham
Code: Select all
set choice=banana
set /p "choice=Pick your fruit (default=%choice%): "
echo:Your choice is %choice%.
Dave Benham
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: Menu question
...I knew that. I was drunk (really) lol. I use a choice function I wrote 8 months ago exclusively now, so it was in the back of my mind.