根据 temp 的意图, 请使用下面的代码, 并保证 Illegal.txt 和 这个bat在同一个目录- @echo off & setlocal enabledelayedexpansion
- for /f "delims=" %%h in (Illegal.txt) do (
- for %%a in (C D E F) do (
- cd /d %%a:\
- for /r %%b in (%%h) do (
- if exist "%%~fb" (echo "%%~fb")
- )
- )
- )
- pause
复制代码 我的运行结果如下:
"C:\WINDOWS\system32\dllcache\iexplore.exe"
"C:\Program Files\internet explorer\IEXPLORE.EXE"
"E:\TEMP\PFiles\Internet Explorer\IEXPLORE.EXE"
"F:\SOFT_INS\PFiles\Internet Explorer\IEXPLORE.EXE"
"C:\WINDOWS\regedit.exe"
"C:\WINDOWS\system32\dllcache\regedit.exe"
"F:\GRTMPVOL_CN (I)\I386\REGEDIT.EXE"
"F:\WINXPSH\I386\REGEDIT.EXE"
"F:\XPSP3INS\I386\REGEDIT.EXE"
请按任意键继续. . .
可以再改一下,即使隐藏的文件也会显示出来- @echo off
- for /f "delims=" %%h in (Illegal.txt) do (
- for %%a in (C D E F) do (
- dir "%%a:\%%h" /ah /s /b 2>nul
- dir "%%a:\%%h" /s /b 2>nul
- )
- )
- pause
复制代码
[ 本帖最后由 neorobin 于 2009-12-23 01:22 编辑 ] |