@echo off tasklist /FI "IMAGENAME eq outlook.exe" | find /i "outlook.exe" IF ERRORLEVEL 2 GOTO LOOP2 IF ERRORLEVEL 1 GOTO LOOP1 :LOOP1 start notepad.exe goto EXIT :LOOP1 start outlook.exe goto EXIT :EXIT
@echo off tasklist /FI "IMAGENAME eq outlook.exe" | find /i "outlook.exe" IF ERRORLEVEL 2 GOTO LOOP2 IF ERRORLEVEL 1 GOTO LOOP1 :LOOP1 start notepad.exe goto EXIT :LOOP1 start outlook.exe goto EXIT :EXIT