|
@echo off
pushd %~dp0\
setlocal enabledelayedexpansion
for /f "tokens=1* delims=." %%a in ('dir /ad /b /tc /o-d') do (
set n=0
for /f "tokens=1,4" %%c in ('dir /ad /tc /o-d %%a.* ^| findstr /i /r "[12][90][0-9][0-9]" ^| findstr /v /i "\.$"') do (
set /a n+=1
set fn-!n!=%%d
set var=%%c
set "fd-!n!=!var:~0,4!!var:~5,2!!var:~8,2!"
)
if defined fd-2 if "!fd-2!" lss "!fd-1!" rd "!fn-2!" /s /q 2>nul
)
pause
exit
|
|