自己复制一些文件测试下:- @echo off&setlocal enabledelayedexpansion
- set ext="*.jpg.* *.bmp.*"
- (for /f "delims=" %%a in ('dir /b/s "%ext%"^|findstr /e ".[0-9]"') do (
- set "str=000000%%~xa"
- echo,%%~dpna/!str:~-8!
- ))>tmp
- for /f "tokens=1-2 delims=/" %%a in ('sort tmp') do (
- if "%%a"=="!file!" (
- del /q "%%a%%~xb"
- ) else (
- set "file=%%a"
- )
- )
- del tmp
复制代码
|