The examples will only help if the miner crash.
I'm also use the similar code (EWBF examplee):
echo off
timeout /t 45
:startmnr
echo %date% - %time% start mining >> log.txt
miner --server SERVER --port PORT --user YOUR_WALLET --pass YOUR_PASSWORD --cuda_devices DEVICES --eexit 3 OTHER_MINING_SETTINGS
echo %date% - %time% miner error >> log.txt
echo %date% - %time% restart miner... >> log.txt
goto startmnr
pause
But It could happened the issue when only rig reboot is required. In this case the following opensource utility will help:
https://github.com/Dimasin/fermtools/releasesSimple settings alows to soft reboot your rig if a GPU hung