@Echo off
rem Info zur Version:
rem Datum        Wer     Info
rem 24.03.2010   J.Fes   ueberarbeitet

if #%2#==## (
 Echo Err: [Call %0]& Echo Err: missing paramters
 Echo Inf: P1=Prog_N P2=Prog_DPNE
 Echo Example: PlmJobManagerWatchDog starten
 Echo call "ProgIs_Running.cmd" "PlmJobManagerWatchDog"  PlmJobManagerWatchDog_isRunning
 goto :eof
 )
setlocal
 rem -- Rootpfade setzen
 set ExeToRun_N=%1
 set ExeToRun_N=%ExeToRun_N:"=%
 tasklist /FI "IMAGENAME eq %ExeToRun_N%*" 2>nul | findstr /i /c:"%ExeToRun_N%">nul
 set ExeToRun_isRuuning=%errorlevel%
REM  Echo ExeToRun_isRuuning=%ExeToRun_isRuuning%
 if "%ExeToRun_isRuuning%" neq "0" set ExeToRun_isRuuningR=0
 if "%ExeToRun_isRuuning%" equ "0" set ExeToRun_isRuuningR=1

 if "%ExeToRun_isRuuningR%" equ "0" Echo "Prog:[%ExeToRun_N%]: Is NOT Running
 if "%ExeToRun_isRuuningR%" equ "1" Echo "Prog:[%ExeToRun_N%]: Is running"
endlocal& set %2=%ExeToRun_isRuuningR%
goto :eof
