Trick is to use tasklist.exe and pipe the output through a find then check the errorlevel as follows...
tasklist /FI "IMAGENAME eq WebDev.WebServer40.exe" 2>NUL | find /I /N "WebDev.WebServer40.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO START
echo. Starting web app dev server
call sw.bat
:START
No comments:
Post a Comment