@echo off

:loop
wildrig.exe --algo evrprogpow --url stratum+tcp://stratum.coinminerz.com:3321 --user EPg5kPba6crYWqpnUvCRb1kJHTHZTJ2rgF --pass x

if ERRORLEVEL 1 goto custom
timeout /t 5
goto loop

:custom
echo Custom command here
timeout /t 5
goto loop