findstr 放在for 外层,效率上也许会好些:- @echo off
- set "targetPath=D:\test\"
- pushd "%targetPath%"
- (
- echo;程序名称 版本号 备注
- for /f "tokens=1,5delims=\:" %%i in ('findstr /is "Revision:" *.log^|findstr /ib "[^\\]*\\compile\.log:"')do (
- echo;%%i %%j
- )
- for /d %%i in (*) do if not exist "%%i\compile.log" echo;%%i 未编译
- )>"%~dp0apprevision.txt"
- pause
复制代码
|