Tech Support > Operating Systems > MS-DOS > How to find all files in a dir tree which contain pattern "abc" in the their filename or path ??
How to find all files in a dir tree which contain pattern "abc" in the their filename or path ??
Posted by Mark Richards on September 12th, 2004


It is rather simple to match all files which contain pattern (e.g. abc) in their file name.
But it is more complicated to identify all files and directories which contain this pattern
only in their path !!

Mostly the following files were NOT found:

D:\myproj\abc\sample\karl.txt
C:\test\__abc\logs\log2004.dat
C:\anotheridr\subdir\xxabc (<--- empty dir !!)

How do I write the filename (including the path) of all files in a directory tree
(e.g. C:\myfiletree downwards) containing pattern abc in their filename or their
path to a text file (e.g.list.txt)?

Mark

Posted by Matthias Tacke on September 13th, 2004


Mark Richards wrote:

Hello Mark,
you've got 15 responses from regulars in the groups you crossposted to.

Due to your follow up to comp.os.msdos.misc they couldn't see that you
already have a very similar answer.

dir c:\myfiletree\* /s /a /b | find /i "abc" > path\list.txt

IMO using only ambnt would have been fine.

xpost: alt.msdos.batch,comp.os.msdos.misc,comp.os.msdos.p rogrammer,
alt.msdos.batch.nt

And F'up set to : alt.msdos.batch.nt

PS: With that much effort from many people a feedback or an apology
might keep you getting answers in the future.

--
Greetings
Matthias