There's a program that will sometimes run for a long time that I don't want to stop in the middle of a file. When that happen I'll look at the program in between my tasks, that I estimate the vast majority of the time are between 2 & 10 mins. The program shows the file name it will output when the task is complete.
I'd like a batch file or script to "keep an eye" in the output directory for a file with a pattern that matches what's displayed on the program appear, and when it does execute a command to close the program (taskkill /f /im NAME.exe). It doesn't have to constantly look, every 1-3 mins is fine.
Thank you kindly for your help
Update 1
I'd also like a timeout in case the file-creating program crashes or I entered the file pattern incorrectly, ie 6 hrs.
I'd like a batch file or script to "keep an eye" in the output directory for a file with a pattern that matches what's displayed on the program appear, and when it does execute a command to close the program (taskkill /f /im NAME.exe). It doesn't have to constantly look, every 1-3 mins is fine.
Thank you kindly for your help
Update 1
I'd also like a timeout in case the file-creating program crashes or I entered the file pattern incorrectly, ie 6 hrs.
Last edited: