Take the 2-minute tour ×

Is there a way in Windows XP to search for a particular file containing the word "jack_user" inside multiple directories with multiple files?

share|improve this question

migrated from stackoverflow.com Sep 23 '11 at 3:48

This question came from our site for professional and enthusiast programmers.

8 Answers 8

I'd use findstr as follows:

C:\some\directory\>findstr /s /i "jack_user" *
share|improve this answer

You want to use the Windows search engine?

In this window you can set the word "jack_user" in "A word or phrase in the file: " and you can select the root folder in "Look in" combo box:

enter image description here

share|improve this answer
This does not always work. It ignores some files and/or results. Haven't figured out the exact pattern. For example searching for FOO finds a file named aaa.sql that contains the string xxx.foo, but not another file bbb.sql that contains XXX.FOO. Then searching for XXX.FOO doesn't find any of those files. It is completely unreliable and therefore useless (it worked fine in Windows 2000 thou...). –  David Balažic Jul 25 at 13:32

You can use Microsoft Windows Search SDK

share|improve this answer

I believe your best bet is to use the windows sdk for search functionality

Legacy WDS 2.x Search

Newer Windows Search

share|improve this answer

Yes, you can. When you search for a file you can supply some certain text that should be contained within the files' content. And you can also provide which directory it should be searching in and also if it should go through all subdirectories.

The only problem is, that the Windows search only searches within files of certain types (listed here). It might not find what you are looking for.

There are some tools out there, that search within EVERY file. Google hits up some results.

If you want to do it programmatically, you can use the Search API, although I am not sure if it has the same limititations. If it does you probably will have to open every file you come across and check the contents with a regular expression.

share|improve this answer

With a GUI in XP I would use "Lookdisk" because it is freeware, and i understand how to use it. It will search internally in everything you ask it to, which can take a long time, and come up with false positives too depending on the complexity. For me it was better than all the misses from other tools.

When searching more complex stuff like "text" in programs/exe, I can use the "text to hex", and put the complimentary 00s in it also, to find where a exe or dlls internal text items came from. There has not been anything that i could not search for, no mater where it was or how it was. also will show the line numbers and that kinda stuff.

call me lasy, but i can send it out gleening through internals for something, taking so long that i just ignore it and come back to it. but it beats trying to see "the matrix" :-)

share|improve this answer

If you have access to PowerShell I would use Get-Content

share|improve this answer
But how does one use Get-Content to search a file with specific contents? –  Tom Wijsman Oct 31 '11 at 13:20

I use Wingrep, a port of the Linux tool. It works nicely and gives you the line number and file name.

share|improve this answer
if your looking for a non-programmatic option (or command prompt) this would be a pretty good way to do it. Another option is installing Windows Search 4.0 for XP and using that –  Xeno Sep 22 '11 at 20:43

Your Answer

