I have the following code that executes a program with the /wait flag so that the next line doesn't execute until the first process is killed.
START "" /wait "Process1.exe"
START "" /wait "Process2.exe"
The problem is that sometimes the process can error out and never end, so I would like to also implement a timeout of 5 minutes, so that if the process is still going after 5 minutes, the timeout would kill it.
Ideally, I would like to be able to use both if possible, so that if the process finishes in 2 minutes, I don't always have to wait the entire 5 minutes.
Is this possible?
Thank you!