I currently have this batch script:
start udp%1.exe
timeout /t %2
taskkill /f /im "udp%1.exe"
This works great and kills the program after a selected amount of time, however if I was to manually close udp%1.exe and start another one with the same ID the timer from the other batch script is still running and will kill the next launched. I'm not entirely sure if I can check if the process is still running in batch? and if so to close the timer so it doesn't kill others with the same ID?