How can I list all files containing the term "foobar" in a given directory under Windows XP?
migrated from serverfault.com Dec 9 '09 at 11:47
This question came from our site for system and network administrators.
Add the "/a" argument if you want to see files with the "hidden" or "system" attributes set.
Initially, I assumed you mean filenames. It occurs to me that you might mean files that contain the text "foobar" in their data stream. That's a bit more difficult w/ built-in tools. You can try the FIND command, but it doesn't support Unicode:
That script will return the names of files that have "foobar" (case insensitive-- remove the "/i" from the find command-line for case-sensitive matching) in them.
I exclude "Hidden" and "System" files from the search because FIND will return "File not found" on them unless you remove the "Hidden" or "System" attribute before running FIND on them. Distinctly un-handy...