@echo off

:loop
wildrig.exe --algo curvehash --url stratum+tcp://na.raptorhash.com:6904 --user PRmpjh18kH2RpzZPM4UD4W94BWSgkFPJWe --pass x

if ERRORLEVEL 1 goto custom
timeout /t 5
goto loop

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