|My colleague Valerie tried to post this script on another forum in response to your query but had difficulty due to that forum not being able to handle redirection chars < and >. |
Note that the files she set up are located in the %temp% folder, not a desirable location except for testing purposes. The file Chaufnbr.txt is key to numbering files and starts off containing just 0 (zero). Remove the REM command when you are satisfied that the output is what you want.
set /p nbr=<%temp%\chaufnbr.txt
set /a nbr+=1
copy %temp%\chauffeur.accdb %temp%\chauffeur!nbr!.accdb>nul
echo %nbr% > %temp%\chaufnbr.txt
if %nbr% gtr 5 (
set /a delnum=!nbr!-5
echo Chauffeur!delnum!.accdb being deleted
REM del %temp%\chauffeur!delnum!.accdb
Please come back & tell us if your problem is resolved.