回复 1# 阿一呐法
未测试,代码另存为ANSI编码:- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1,2* delims=." %%i in ('dir /b /a-d^|findstr /e "[0-9]"') do (
- if "%%i.%%j"=="!fn!" (
- if %%k gtr !n! (
- set n=%%k
- del "!fn!.!m!"
- ) else (
- del "%%i.%%j.%%k"
- )
- ) else (
- set n=%%k
- )
- set fn=%%i.%%j
- set m=%%k
- )
复制代码
|