@echo off
del 提取.txt & cls
for %%a in (*.*) do (
findstr "PTRE" "%%a">nul>>提取.txt)
echo 已完成!
pause & exit
保存为 .bat 批处理格式文件在当前目录下运行
中国批处理脚本联盟
(for /f "delims=" %%a in ('dir /b/a-d *.*') do (if /i not "%%~xa" == ".bat" findstr "PTRE PTRP PTRC" "%%a"))>Result.txt
@echo off
(for /f "tokens=1* delims=:" %%a in ('findstr " PTRE PTRP PTRC" *.*^|findstr /bc:"%~0"')do echo %%~fa %%b)>e:\ptre.txt