Goodwill
Goodwill

Reputation: 53

find through command prompt

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

Upvotes: 1

Views: 233

Answers (4)

Anders
Anders

Reputation: 101666

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

Upvotes: 0

Marcelo Cantos
Marcelo Cantos

Reputation: 185862

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

Upvotes: 2

YOU
YOU

Reputation: 123841

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

Upvotes: 1

anonymous
anonymous

Reputation: 3544

Try using dir *.txt

Upvotes: 0

Related Questions