例如,你要查找的那堆文件在d:\test目录下,关键字符为sdf: @echo off for %%i in (d:\test\*.*) do (type %%i |find "sdf">nul && echo %%~nxi) pause