I just did a quick Google search and this is what I found:
How to check if a process is running via a batch script
windows - How to check if a process is running via a batch script - Stack Overflow
And here's the code that's posted that looks interesting and it's set up for Notepad. So there might not be much adjustments required to it.
Note: It's the second answer in the thread.. I'll check it out ASAP.
tasklist /FI "IMAGENAME eq notepad.exe" /FO CSV > search.log
FOR /F %%A IN (search.log) DO IF %%~zA EQU 0 GOTO end