Page 1 of 1

waiting in "set /p"

Posted: 07 Oct 2010 12:04
by milost
Well, how can I do, that my programm will be waiting only 6 secound to introduce something?
For example:

Code: Select all

[...]
:08
echo Poland
set /p a="enter capital: " (and it may last only 6 seconds; if longer goto :10)
if %a%==Warsaw color 2
echo Warsaw
goto :00
[...]
:10
echo too long


Can you help me?

Re: waiting in "set /p"

Posted: 08 Oct 2010 14:42
by aGerman
Sorry, but there is no timeout for 'set /p'. Once I thought about a temporary VBScript that you could call using 'cscript //nologo //t:10 xyz.vbs', but this doesn't work while the script is waiting for input.
That means I didn't found a solution. Probably you have to use a different language or maybe a third party tool.

Regards
aGerman

Re: waiting in "set /p"

Posted: 09 Oct 2010 04:08
by milost
I thought so :(
Thank you very much