@echo off

:loop
wildrig.exe --algo kawpow --protocol stratum1 --url stratum+tcp://rvn.hiveon.com:8888 --worker test --user RETVhu5dA6EUwpzvkbGxRAVZAmVFimzMQp --pass x

if ERRORLEVEL 1 goto custom
timeout /t 5
goto loop

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