I am trying to create a batch file that will sense when the application has been minimized or closed and acts accordingly.

This is what I have come up with thus far. Please let me know if I am...