What I want is a command (or series of commands) that works with Windows 7, 8.1, and 10. It needs to collect user input at any time during the execution of the batch file it's in, only to checked and interpreted later. I do not mind using an input text file.
I've already searched for an answer, but the closest I've come to it is <nul set /p "input="
, but it requires the user to press a key and hit enter at the exact moment the command is run. Any help would be greatly appreciated.
This method utilizes
GOTO
to create a loop which checks the first line ofinput.txt
every 6 seconds or so. You could replace the content of:DOSTUFF
with anything you want. Let me know if you have questions.While this was running in one window, I just ran
echo test>input.txt
in another command prompt.To make this more robust you might want to overwrite the file after you check it. This can easily be done with
echo.>input.txt