A while ago I needed to wait for a process in a batch file to finish before the script continued. I did it by using an If statement to create a ‘spoof’ loop, with a delay between each loop iteration of 5 seconds. This example waits for the ‘Java.exe’ process to end before the script continues:

