I need to run a counter and a timer at the same time, but I'm not sure about how to achieve it.
I have a batch fil开发者_StackOverflow中文版e that counts the number of times any key is pressed in an easy loop made by a goto, once its done (keypress) for the first time, it fires a timer for 1 min; the key pressed in that time, must be stored in another variable.
My problem is that I don't know how to make the loop to continue running while the timer is counting, because I tried two options without success:
Hope I explained myself correclty and somebody can help me, thanks, Dan.
You can run parallel threads in one cmd session. use start command with /B parameter, it will start your batch in the current cmd window.
Start /B myBatch.bat param1 param2 ...
you can continue work while myBatch.bat runs in the background (and output to the current window).
note ^C will not kill it, only ^Break.
easiest way to make sure task is killed is to end myBatch.bat with exit command.
精彩评论