我晕还是有BUG,b.txt多显示了一遍- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-h /s e:\新建文件夹\*.txt') do (
- for /f "delims=" %%i in ("%%~nxi") do (
- if not defined %%i (
- set %%i=A_ ) else (
- set str=%%~nxi
- for /r "e:\新建文件夹\" %%i in (!str!) do (
- if exist %%~fi echo. %%i#%%~fi#%%~ni#%%~ti#%%~zi >>tmp_.txt
- )
- )
- )
- )
- pause
- for /f "tokens=1,2* delims=#" %%i in (tmp_.txt) do (
- if not defined %%j set %%j=A & echo %%i %%j %%k>>结果.txt
- )
- del tmp_.txt
复制代码 你再用这个看看能不能用
[ 本帖最后由 sgaizxt001 于 2010-4-26 07:41 编辑 ] |