I have a script with a for loop that works but I would like to change the echoed line so that it includes the number of retries remaining.
Below is my latest attempt but I cannot get it to show the number of retries:
rem Will loop 20 times with 30 second intervals (Total 10 minutes) to confirm deletion. Loop will exit after 20 attempts and move on if dll cannot be deleted.
for /l %%i in (1,1,20) do (
set /a "count=20-=%%i"
del /f /q "%Folder2Del%file*.dll" >nul
if not exist "%Folder2Del%file*.dll" goto Folder2Del
echo/
echo File locked! Will try to delete %count% more times before exit.
timeout /t 30 >nul
)
I've searched and tried to apply many examples but I just can't get it working. I don't know how to properly set my 'count' variable.