日志扫描脚本

@echo off
color 6
:start
set "scan_str=zx sh"
echo 要扫描的字段为:%scan_str%
set "current_dir=%cd%"
echo %cd%
set /p batch=拖入要处理的文件夹:
pushd %batch% || goto start
if not defined batch goto start
for /f "tokens=* delims=" %%i in ('dir /s /b /a-d *.txt') do (findstr /s /I /N "%scan_str%" "%%i" >>result.txt
rem if exist "%scan_str%" = "%scan_str%" (echo 存在密码信息) else echo 此文件不存在密码信息
)
echo 扫描完成!
pause
goto :eof

  

posted @ 2021-11-15 01:17  未燃烧的小火苗  阅读(80)  评论(0)    收藏  举报