Is it possible to increasement an integer counter in a batch file script? Example: Set Sleep=0
:Rerun
osql ...
if %ERRORLEVEL%==0 goto :Cont
Set Sleep=%Sleep%+1
if %Sleep%==3 goto :ErrorOut
goto :Rerun
:ErrorOut
exit %ERRORLEVEL%
:Cont
...Basically, I need to run a SQL Server Stored Procedure until it successfully runs before I want the script to error out. Currently, the result for %SLEEP% will be '0+1' after the code above runs, not 1. Can anyone help?

Rewrite your code as below Set Sleep=0
:Rerun
osql ...
if not ErrorLevel 1 goto :Cont
Set /A Sleep+=1
if %Sleep% lss 3 goto goto :Rerun
exit %ErrorLevel%
:Cont
...
Worked like a charm. I love it when there are people smarter then I am out there that don't mind helping out. Thanks!!
