本帖最后由 terse 于 2013-6-30 02:16 编辑
刚刚的回贴怎么不见了- @echo off&setlocal enabledelayedexpansion
- set "filepath=d:\123\"
- del tem$ 2>nul
- for /f "tokens=1,2* delims=:" %%a in ('findstr /isn . "%filepath%*.txt"') do (
- set "str=%%c"
- set str=!str:%filepath%=^
-
- !
- for /f "tokens=1,2* delims=:" %%i in ("%%~nxb:!str!") do (
- for /f "tokens=*" %%s in ("%%j=%%k |2") do (
- if defined t if "!t!" neq "!filepath!%%i" move tem$ "!t!"
- >>tem$ echo %%s
- )
- set "t=!filepath!%%i"
- )
- )
- move tem$ "!t!"
- pause
复制代码
|