You could do this with 3rd party software to test for the PID of the program running, and if the PID is running do one thing and if not running do something elese etc.
DOS Batch isnt smart enough to do what you want unfortunately without another program to interface through an API etc to Windows