Checking if the application is running from a batch file?
4 answers
on windows you use pstools pslist to check if the process name is running with a .cmd script like below. Pslist will return ERRORLEVEL 0 if the process is running, 1 if not.
@echo off
CommandYouWillRun.exe
rem waiting for the process to start
:startcmd
sleep 1
c:\path\to\pslist.exe CommandYouWillRun > NUL
IF ERRORLEVEL 1 goto startcmd
rem the process has now started
:waitforcmd
sleep 1
c:\path\to\pslist.exe CommandYouWillRun > NUL
IF ERRORLEVEL 1 got finished
goto waitforcmd
:finished
echo "This is an error message"
+5
Helper1
source
to share
You can write powershell-script and use get-process with filtering.
http://www.computerperformance.co.uk/powershell/powershell_process.htm
+1
source to share