Код:
![Выделить весь код](images/misc/selectcode.png)
@echo off &setlocal enableextensions
set /a Last=10
call :rd "z:\arhiv\0\1\2"
call :rd "z:\arhiv\0\1\3"
goto :eof
:rd
for /f "skip=%Last%" %%d in (
'dir /b/ad/o-n "%~1\????????" ^|findstr /rbec:[0-9]*'
) do rd /s /q "%~1\%%d"
goto :eof
оставляет последние 10