Author

Topic: Late windows DOS batch file logic question... (Read 420 times)

legendary
Activity: 1848
Merit: 1166
My AR-15 ID's itself as a toaster. Want breakfast?
Code:
:wait1
set EXE=ccminer.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
goto FIN1
:FOUND
echo %EXE% still running.
goto wait1
:FIN1
:wait2
set EXE=ccminer_.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
goto FIN2
:FOUND
echo %EXE% still running.
goto wait2
:FIN2
:wait3
set EXE=ccminer50.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
goto FIN3
:FOUND
echo %EXE% still running.
goto wait3
:FIN3
:wait4
set EXE=ccminer-DCD.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
goto FIN4
:FOUND
echo %EXE% still running.
goto wait4
:FIN4
:wait5
set EXE=ccminerB2S64.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
goto FIN5
:FOUND
echo %EXE% still running.
goto wait5
:FIN5
goto start
legendary
Activity: 1848
Merit: 1166
My AR-15 ID's itself as a toaster. Want breakfast?
So I am working on an upgrade idea for my GPU miner's batch file.

There has to be a way to check if an app is running through the terminal window and use it with logic in a batch file.

such as:

:beginfile
start ccminer.exe --options
:memoryloop

  true, wait x time and goto memoryloop
  false, goto beginfile


Any ideas guys?   Probably going to have to define a variable for the true/false?

I never learned the advanced windows-connected DOS commands...
Jump to: