I am trying to automate the starting of the OpenOCD damon within Eclipse and/or batch files, and I want to avoid opening multiple instances of the damon.
Is there an way to test this in a batch file?
Is there ever a reason to have multiple OpenOCD daemons running? If not, OpenOCD should test if an instance is running already and exit. Or, it would be nice to have a command line switch that will only start up the daemon if it isn’t allready running. (or vice-versa)
jqpublick:
I am trying to automate the starting of the OpenOCD damon within Eclipse and/or batch files, and I want to avoid opening multiple instances of the damon.
Is there an way to test this in a batch file?
Is rather easy to do, I took some sample code from msdn and adjusted it a bit to suit your needs.
AppRunning.exe winamp.exe
if errorlevel 1 goto running
echo "Not running"
goto end
:running
echo "running"
:end
Since it’s just a quick hack it’s not as userfriendly as it could be, there is no validation on command line parameters and the processname you enter must match exactly as it shows up in the taskmonitor (case sensitive).