Quote:

Also, if I do a "? $proc" it will return the PID if the application is running. If the exe isn't running, there is no PID returned.



You just answered your own question. Think about it. If @ERROR isn't the answer, then what logic would you used based off of the above quote to run a loop the way you need to???