- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%j in (a.txt) do (
- set "x=%%j"
- (for /f "delims=" %%a in ('findstr /c:"%%~nxj" a.txt') do (
- echo %%a )>> 8.txt
- type 8.txt|find /c /v "">7.txt
- del 8.txt
- for /f "delims=" %%i in (7.txt) do (
- if "%%i" gtr "1" (
- echo !x! >>11.txt
- ) else ( echo !x! >> 10.txt )
- )))
- del 7.txt
- pause
复制代码 11.txt里面是重复的文件路径 10.txt是删除重复后的剩下的文件路径
[ 本帖最后由 yhcbird 于 2011-1-16 20:20 编辑 ] |