In windows 7 - I want to search for all files containing "A word or phrase in the file". The standard XP search box.

Anonymous
2009-12-06T19:24:59+00:00

In Windows 7 - I want to search/find all files containing "A word or phrase in the file".  The old standard XP search box.

I do NOT supply: file name; file type; drive letter; etc. - nothing.  

I tried searching for this - just can't find any discussion.  And of course, not having this search would be insane. It is precisely what we have a computer for. 

And no 3rd party programs are allowed.

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-08-19T18:11:15+00:00

I've been looking into this because I know the search has been failing for me.  I think the difference in whether Windows search works or not depends on the FILE EXTENSION which contains your search text.  For example, if you look for the word "spam", it will be found if it is in a whatever.doc file, or whatever.txt file.  However, if you were to rename the file to whatever.xyz, it will no longer find the word.

Here are all the steps I think you need to follow to actually search:

  1. Make sure that Windows 7 is actually going to search files with your extension, and it appears that using this list properly is important *whether or not you are looking in an indexed location*!!

    a.  Hit the start button and type "search" in the search box.

    b.  Select "Change How Windows Searches"

    c.  Hit "Advanced"

    d.  Select the "File Types" tab.

    e.  Make sure the file extension for the files you want to search in is on the list *and* is set to "Index Properties and File Contents" (yes, pick your jaw up off the floor).  I know this appears to be for file indexing, but it does seem to make a difference on whether you find the file in non-indexed locations as well.

    f.  Say "Ok" and exit all the dialog boxes

2.  Actually perform your search on the folder in question.  Depending on some other settings you may have to type "content: spam" to find "spam" *in* the files instead of files with the word "spam" in the name.  Alternately, if you press the "Alt" key when you're exploring in the folder, you can choose "Tools / Folder Options" go to the "Search" tab and select "Always search file names and contents".

If what I have written is actually correct, then IMHO Microsoft has coughed up the ball bigtime on this one.  Personally, I now recognize that I can't use the search feature, and I'm installing Cygwin so I can use "grep" to search the contents of files.  Not cool and not amused.

Good luck to all the searchers.

~Pete

Was this answer helpful?

100+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
@CmdrKeene 90,631 Reputation points Volunteer Moderator
2010-09-19T13:39:48+00:00

There is an option that seems to match what you're looking for:


If this was helpful, please vote by clicking the green triangle. If it solves the issue, click Propose as Answer. Thanks!

Was this answer helpful?

20+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2009-12-09T00:08:07+00:00

To find "phrase in the file" type content:"phrase in the file" in the searchbox.

Was this answer helpful?

20+ people found this answer helpful.
0 comments No comments

364 additional answers

Sort by: Newest
  1. Anonymous
    2010-09-19T05:06:32+00:00

    Windows Search fails this simple user scenario:  find all files containing specific text

    That's the scenario.  Pretty simple.  Due to complexities in the Windows Search function, I must add additional descriptive information (even though intuitively it should not be needed)...1. I don't want this search limited just to files in a pre-determined list of file types known to some indexing service, 2. I don't want this search just to occur in special folder locations that are in or not in the list of indexed folders.  I am not in a hurry...I want completeness and robustness (a "gotcha free" search).  Microsoft is tilting so far in the direction of "fast performance"(indexing and extension specification) that they are sacrificing "ease of use"....and MORE IMPORTANTLY not giving me any simple way to override the performance-biased search in favor of one biased toward ease of use and robustness.

    Specifically, I have a database connection wizard that has some setting that I can't track down.  It is a needle in a haystack.  I am sure it is hiding in some configuration file (.xml, .config, .other).  Boy, wouldn't it be nice if I could *search* for it!?!  Ahem, well we've introduced all this complication so you can get fast searches!  But I don't care about speed right now...I want reliability, ease of use, completeness, robustness...I am trying to find a dang needle in a haystack here.  I don't know what file extension it might be lurking under.  I also don't know what folders (indexed or not) that it might be lurking in.  I need to search far and wide......but not with the type of search Microsoft has provided...I don't care about performance right now, I'm trying to find a tough-to-find item.

    I believe I have tried all solutions provided in this thread and none address the user scenario described above.  (FYI, I still haven't found the file I'm looking for)

    My proposed solution to Microsoft:  Add an option "Search All (slow)" for a folder.

    This would search filenames and file contents for all files and all file extensions (regardless of any settings anywhere in the OS.  It would find text inside files with arbitrary and unknown file extensions (junk.xju).

    If you want to test what I'm describing...

    1. in Notepad, create 2 plain text files called testfile.txt and testfile.xjq (I used a website to test that XJQ is not a known popular extension, so it very likely won't be in your indexing options file types list...i.e., it will be 'unknown' to your computer's indexing service)
    2. type the word "hello" in both files
    3. try to search for this file using the following search query (typed into the Windows search field)

    content:"hello"

    Result:  testfile.txt will be found, but testfile.xjq will not be found.

    (FYI, after the search failed to find both files, I selected the "Search again in" "Custom" option...I specified the folder.  Again, only 1 of the files was found.  Still doesn't search for file types not known to the indexing service.)

    Was this answer helpful?

    0 comments No comments