其实,17楼 xxpinqz 的思路非常不错,只是楼主不识货。
小改一下 :- @echo off & setlocal enabledelayedexpansion
- pushd "D:\test\"
- if "%1" == "OK" (
- for /f "delims=" %%a in ('dir /b/s^|findstr \.[0-9][0-9]*$') do (
- set "str=0000000000%%~xa"
- set "str=!str:.=!"
- echo,%%~dpna/!str:~-10!%%~xa
- )
- ) else (
- for /f "tokens=1*delims=/" %%a in ('"%~0" OK^|sort /r') do (
- if /i "%%a" == "!file!" (
- echo Del "%%a%%~xb"
- ) else set "file=%%a"
- )
- pause
- )
复制代码
|