I want to loop over a set of data in a folder and pass the data as parameters to a program in a batch file. The problem is that when the program has finished running, it expects the user to input a keystroke to terminate it, eg ‘q’. How do I send the keystroke to the program in this case?
This is as far as I got
for %%a in (*.txt) do program.exe %%a
You can send input to a problem usually via
echo:This won’t help if the program expects actual keyboard input, though. It only works if it reads from the standard input stream.