开发者

find through command prompt

How to find all the *.txt files in any directory(i.e.开发者_开发技巧 c:\,d:\ etc.) through command prompt?


c:
cd \
dir /s *.txt
d:
cd \
dir /s *.txt


Following will search from root directory and its all accessible sub folders regardless of the folder you currently in.

dir \*.txt /s

or

dir c:\*.txt /s
dir d:\*.txt /s

etc


Try using dir *.txt


setlocal ENABLEEXTENSIONS
FOR %%A IN (a b c d e f g h i j k l m n o p q r s t u v w x y z) DO @call :dumpdrive %%A
echo Done...
goto :EOF
:dumpdrive
FOR /R "%1:\" %%B IN (*.txt) DO @echo.%%~fB
goto :EOF
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜