@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