Batch Command Timer thingy

November 28, 2012 at 20:59:34
Specs: Windows Vista

Sorry about the title, i didnt know what to name it
is there a way to get a batch program to have a timer running in the background while waiting for a command?

for example
the batch file says

quick type help!

you then have five seconds to type "help" or batch file opens 23 random windows
anyway, is this possible?
if not what will it work on?
thanks for any help

by the way after you type help it does

goto x
( i dont know why i added this)


See More: Batch Command Timer thingy

Report •

November 29, 2012 at 08:25:14

You can issue a choice command with the default response set after n seconds.

However this command is not supported under XP and has a slightly different syntax under Win 7 (type choice /? to know how it works). More the choice is limited to ONE alphanumeric character.


echo.Type h as fast as you can
choice /N /C:@,h /T:@,5
if ErrorLevel 2 goto :HELP
echo.Nothing entered

Report •

December 2, 2012 at 20:33:13

thanks for the reply it really helped but it seems that the "choice" command only lets you do a key press as an input is there a way to change it so you can type a word?
do you know what i mean?


Report •

December 3, 2012 at 02:40:21

Unfortunately NO. Choice does allow a list of alphanumeric characters only, i.e. key press, and if you do a key press though a wrong one, the coundown timer is stopped. Due to the architecture of batch scripts there is no viable way to achieve what you wish.

Report •

Related Solutions

December 3, 2012 at 19:39:24

all right thanks anyway


Report •

Ask Question