[Solved] Help with vars in batch?

Vote Down
Score
1
Vote Up
February 10, 2012 at 19:44:49 Pacific
Specs: Windows 7

Okay the question wasn't entirely accurate... makes me seem very noobish... Here's what i really want to ask:

Is it possible to remove the requirement to push <enter> after a set /p thing? I'm asking this because i have a long script with a ton of Y/N questions and wish to make easier user interface by having the user only need to press <Y> and not <Y> <enter> (or <N>) and some questions have an additional answer like Y N or Q (for like question or something).

I also realize that the answer is probably "No." Hopefully it's "Yes" or (more likely) "Yes, but requires a TON of code." and like I said not a noob so give me the TONS of code if you answer the latter!

FYI It would be helpful if there was a certain amount of time to answer the question ex. If you don't press Y or N in 30000 milliseconds then auto pick N. That might come in handy in a few spots of my script.


Jump to Best Answer ↓   Report •


#1
Vote Down
Score
1
Vote Up
February 10, 2012 at 23:09:47 Pacific

Best Answer

What versions of windows must it run on?

The "choice" command is available in vista/7 and can do single character input without enter and has a timeout default option.

http://technet.microsoft.com/en-us/...


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
February 11, 2012 at 19:19:09 Pacific

@Judago Thank you. I have windows 7

Reply ↓  Report •

#3
Vote Down
Score
0
Vote Up
February 11, 2012 at 19:36:13 Pacific

And as an added bonus... I no longer have to worry about people answering a Y/N question with something like Q. That will make coding a little easier...

Reply ↓  Report •

#4
Vote Down
Score
0
Vote Up
February 12, 2012 at 00:08:05 Pacific

No worries!

Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« How do i find a txt file ... how to run project with t... »