====== Check if windows program is running ====== @echo off SET IMA=0 tasklist /FI "IMAGENAME eq APP Executable.exe" /FO csv > c:\sched\csv.tmp FOR /F "usebackq tokens=1 delims=," %%A IN (csv.tmp) DO ( if %%A == "APP Executable.exe" ( SET IMA=1 ) ) IF %IMA% == 1 ( if not exist c:\sched\Notified ( rem Do something touch c:\sched\Notified ) del c:\sched\Notified_E ) else ( if not exist c:\sched\Notified_E ( rem Do something touch c:\sched\Notified_E ) del c:\sched\Notified ) :end del c:\sched\csv.tmp