Batch program to to check if process exists
TASKLIST does not set errorlevel. echo off tasklist /fi “imagename eq notepad.exe” |find “:” > nul if errorlevel 1 taskkill /f /im “notepad.exe” exit should do the job, since “:” should appear in TASKLIST output only if the task is NOT found, hence FIND will set the errorlevel to 0 for not found and 1 … Read more