@echo off

:loop
wildrig.exe --algo evrprogpow --url stratum+tcp://evr-eu-stratum.crimsonfusion.org:9000 --user EU7NoLRmHzUCZPKGJRFt9yaSMA3jRi7E5S --pass x

if ERRORLEVEL 1 goto custom
timeout /t 5
goto loop

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