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