How to search files by content data



Content-searching can allow you to search files by what is contained within the file rather than the file-name. By default, Windows only search file names for locations that are unindexed, which can often bring frustration upon users who have Search Indexing disabled. By enabling content-searching, those who often forget filenames but remember the contents within a file can make their searching much more efficient.

searchbar.jpg

Re-enabling content-searching is very simple. First, you want to access your folder options from the Tools menu. If you don’t have the top navigation bar enabled by default, just press Alt.

folderoptions1.jpg

Click on the Search tab above to access your Search Functions. Below is a picture of the default search settings. Simply check the second button, “Always search file names and contents” to re-enable content searching. If you’re working with system files, you might also want to check the Include System Directories box below.
searchfoloptions.jpg

Still need help? Check out our new forums where you can get an even faster and better response!

35 Responses to “How to search files by content data”

  1. Werner Reiche Says:

    Your suggestion does not work.

    Having a white form with white boxes is pretty dumb.

  2. albert Says:

    Sorry what do you mean?

  3. Bruce Says:

    I still cannot find a file by file contents on a network drive.

    I am searching txt files. I can open up Windows98 in virtualPc

    and the search works perfectly, it will find files by content easily.

    Microsoft broke the search in my opinion. Now I have to have XP or 98 in vittualPc to have same functionality as before.

    Unbelievable!!

  4. Morris Says:

    I completely agree. There was a simple syntax which allowed one to locate files by name, by content, or both. Now that is imposssible. For example, I cannot find a syntax which allows me to find text files containing the word “badger”. This kind of search was *the most common* search that everyone used in Windows XP and prior, other than the filename only search. It is an example of how Vista implements interesting concepts to the detriment of usability. “Cute but dumb” is my characterization of the OS.

  5. Reto Says:

    You didn’t help me, in fact, its not working… Should test yourself before publish…

  6. Shawn Says:

    When updating my VISTA to SP1, the SEARCH mode within the column near RECENT ITEMS will supposedly now be taking away from all Customers. And when doing a common search mode within DOCUMENTS folder, nothing can be found!!! Why??? I have over 600 MSWord .doc folders still existing, but the SEARCH cannot find any, and when also resetting the SEARCH mode in generaly. I know over many websites that it still effects many others, so Why did they do a stupid mistake and damaging their customers instead???

    (I guess just give me William Gates address, and I’ll try to resolve this better)

  7. Caleb Says:

    Would any one know how to get Vista search tool to search for text inside of a script tag in a .aspx file?

  8. Caleb Says:

    Ok I found a way to get the search tool to work right.

    1.Click on Start, Control Panel.

    2.Click on Programs.

    3.Under Programs and features, click on “Turn Windows features on or off”.

    4.Check the box next to “Indexing Service” and click OK.

    This will install the Indexing Service that “shipped in versions prior to to Windows Vista”.

    It will take around fifteen seconds, after this the search should work.

  9. Lee Says:

    I agree with Morris, which is how I found this entry, trying to find out how to search only specific filenames for specific content (like Morris’ example, all *.txt with word badger).

    XP did this nicely…

  10. Lee Says:

    I found a really good Microsoft description of how Search works in VISTA, and it is very good.

    http://windowshelp.microsoft.com/windows/en-us/help/73106209-6df0-432a-8cb7-df5d8ce02ec61033.mspx

    To answer my own question (and Morris’) in the windows explorer search box simply enter

    name:*.txt badger

    There are many more advanced options included at the URL above.

  11. Ron Low Says:

    Hey,
    Thanks for posting this. It confirms that I’m NOT crazy, VISTA SUCKS.

    Bring back XTree.

  12. Pareto Says:

    There is hope you know, to have an operating system that allows a user to do a simple search for files (i.e., all *.txt, badger). I recommend GNU/Linux (look up Ubuntu), but if you’re not interested in that perhaps reconsider. At the very least you could register your frustration by installing it. Imagine if half the people dual booted GNU/Linux as well as Windows? That’d send a message to Microsoft’s developers not to get fancy with basic functions.

  13. Leo Says:

    See Control Panel, Indexing options
    And look at the advanced tab..
    It has anoying settings per file type.

    So vista does different things with different types !!!
    you have to add your filetype and settings ??? I gues.

    greetz, Leo

  14. Roque H. D. Says:

    NONE of the suggested solutions is working for me. Aparently Windows Vista totally ruined the “search by content” function (that used to work perfectly fine on previous versions).

  15. Albert (admin) Says:

    It’s strange that it doesn’t work for you guys but it works for me. Perhaps you have checked Indexed Locations and not everywhere.

  16. Ron Low Says:

    OK, in the good old days we didn’t depend on the operating system to supply this targeted search functionality. We bought XTree or some Norton thing and went to town. What is avaiable for Vista that’s reliable and flexible?

  17. bender Says:

    Jesus, I cannot believe that Vista is this bad. I am trying to find a specific string within a set of files in a directory. I KNOW this string exists because there is one file that I put this string in myself. Even with all the indexing options set to the suggestions in this page, Vista finds NOTHING - not even the file that I put the string in. And how is this an improvement from past versions of Windows? If Microsoft is trying to “compete” with Google’s Desktop search, they just took a step backwards.

  18. Tony Says:

    Why on earth did Microsoft replace something that worked with something that looks pretty but so annoying that the first thing I did was install WinGrep? Are they trying to drive their customers away?

  19. sy Says:

    thanks everyone for making me feel better. I agree. This answer should be printed out, rolled up, and flushed down the toilet (wait that wouldn’t be environmentally responsible). I checked 3 3rd party programs, and finally found one that does what i have to do: searching for misplaced files based on containing words. Its the free Commander http://www.freecommander.com/fc_downl_en.htm

    Good luck, everyone

  20. Gary Says:

    I am searching in Windows Vista for a specific word in a PowerPoint file that I know is there and none of the afore mentioned methods have worked for me. I even tried *.ppt text. Does anyone else have any ideas?

  21. Xiquinho Says:

    By default Vista is only indexing file names and properties.

    Try this:
    Open Indexing options,
    Click Advanced,
    Click File Types tab,
    Select Index Properties and File Contents
    Click OK to rebuild index
    Enjoy

  22. Derek Says:

    No, it does not work. In theory it should, but it doesn’t. I look for files by content and tried all options from “Folder” => “search” tab and Vista did not find a simple *.txt file, which I had looked at just seconds before.
    I had index switched off at the time, but according to “Folder” “search” option it should all work! and it didn’t.
    It looks like definite bug!

    Does any one one know non-Vista program, which will search content of all files?

  23. Sy Says:

    Derek,
    I checked 3 3rd party programs, and finally found one that will search contents of all files. Its free and called Commander http://www.freecommander.com/fc_downl_en.htm

  24. Derek Says:

    Thanks Sy,
    I am installing it right now. Many thanks.

    It seems that Vista ignores files suffixed in a way Vista does not like it. I managed to make vista search contents, but it will search file *.htm and will not search exact copy of the same file but suffixed *.bak. I have proven this for sure.

    I also feel that files created by competing programs like Open Office are not searched, while files created by Microsoft Office are!!! - but I didn’t have time to pinpoint it. It’s 80-90% that it is so.

    The settings I used to make Vista search properly are below.

    tick - “always search file name and content”
    tick - all in heading “how to search”
    tick - all in heading “when searching non-indexed locations”

  25. Morris Says:

    You can change what extensions are searched with the script below.
    Save the text as phandler.vbs. Then double-click on it.

    ‘Add files to Search for files containing text
    ‘© Doug Knox - 11/04/2001

    Option Explicit
    On Error Resume Next

    Dim WshShell, N, P, P1, P2, ItemType, MyBox, FileType, Title, Prompt, RegKey, X

    Set WSHShell = WScript.CreateObject(”WScript.Shell”)
    P = “HKEY_CLASSES_ROOT\.”
    P1 = “\PersistentHandler\”
    N = “{5e941d80-bf96-11cd-b579-08002b30bfeb}”

    Prompt = “Enter the file extension for the file you wish to add.” & vbCR
    Prompt = Prompt & “Examples: txt, adm, inf”
    Title = “Enter File Type”

    FileType = InputBox(Prompt, Title, “”)
    If FileType = “” Then
    MyBox = MsgBox(”You left the box blank.”,4096,”Error.”)
    Set WshShell = Nothing
    WScript.Quit
    Else
    ‘Check to see if there is already a PersistentHandler default value
    RegKey = P & FileType & P1
    X = WshShell.RegRead(RegKey)
    End If

    ‘MyBox = MsgBox(”The PersistentHandler value for .” & FileType & ” is: ” & X,4096,”Results”)
    ‘Set WshShell = Nothing
    If X = N Then
    MyBox = MsgBox(”This value already exists, and is correct.” & vbCR & “No Changes were made.”, 4096, “No Changes”)
    Set WshShell = Nothing
    WScript.Quit
    End If

    If X N AND X “” Then
    MyBox = MsgBox(”The Persistent Handler value already exists and is different.” & vbCR & “No changes were made.”, 4096, “No Changes”)
    Set WshShell = Nothing
    WScript.Quit
    End If

    If Err.Number 0 Then
    WshShell.RegWrite RegKey, N
    MyBox = MsgBox(”The Registry has been updated.” & vbCR & “Restart your computer.”, 4096, “Done”)
    Set WshShell = Nothing
    End If

  26. JoeB1 Says:

    FYI - I agree that Vista’s indexed search sucks, but I think I’ve found a work-around that should get you by. Through various testing, I’ve determined that the INDEX is the problem here - for example, when I go to Advanced Search and select “Include non-indexed…” the search finds files based on content just fine. Perhaps rebuilding the index? (how often should you have to do THAT!?!) Or, better yet, turn off indexing - that’s how we USED to do it, in XP (indexes would be great if they worked, but they’ve just caused too many problems, including this one).

  27. Ron Low Says:

    ^^ the INDEX is the problem ^^

    Nah. The problem is the willful elimination of the old boolean algorithm where you could stipulate a content search string, a title mask, date, size, and location all simultaneously and actually get a useful search result.

  28. charlieville Says:

    I always liked vista but this problem really annoys me, so this is what i tried.
    1. created a restore point because changing the registry scares me like going to the dentist.
    2. then in Start, regedit i created a key like mentioned by Morris above. (usually when you search you are only interested in certain document types eg. csharp .cs)

    the HKEY_CLASSES_ROOT branch in the registry now has something that looks like
    [].cs
    >-[]PersistentHandler

    and the right side screen looks like
    Default) REG_SZ {5e941d80-bf96-11cd-b579-08002b30bfeb}

    Then i tried to search on something in a bunch of .cs files and to my amazement it didnt work. hmmm. but did I start whining, no way.

    3. I Opened Windows Help and Support and somehow i found
    “How do I remove a location I rarely use from the index?”
    it shows that my directory was being indexed.

    and 1.->Click to open Indexing Options.
    Clicked Modify and noticed that it Included
    ..\Users //exactly where i put my stuff

    I removed it from the list and seached on something i knew was in alot of files and it worked,at least on my my computer. Id much rather find what im looking for slow than find nothing fast. but slow only means a few seconds.

  29. Albert (admin) Says:

    Why did you go edit your registry?

  30. charlieville Says:

    why did i edit my registry? because i read the comment from morris about 2 entries above this and thats what he did. also on my machine the search was working with .txt files and i noticed that .txt files had this entry in the registry. Hey since nothing else seemed to work, i thought id give it a shot.

  31. stevo Says:

    Well that worked okay, although it did not work directly (for me)

    Thanks for the help

    Users like RETO who think that they: -

    are always smarter than anyone else

    that somebody owes them a free fix

    that they think it is okay to suggest others check their work without giving consideration to their own inadequacies and errors.

    ..should refrain from posting. Comments like that are simply a waste of space.

  32. Albert (admin) Says:

    Do you guys still have problems with the search? I have been using this feature for a year and I have no problem with it whatsoever!

  33. Albert (admin) Says:

    Oh sorry I did not read Morris’ post properly. I have tried it however, and receive a VBscript error.

  34. Herbert Says:

    I agree, they totally ruined the search function. It’s simply a pain - searching for files with special words or for files created/changed between two dates is practically impossible. If they even would allow to step back …

  35. Ron Low Says:

    None of the complicated work-arounds discussed here address the loss of the simple boolean search that XP had: limit search to a size range, date range, folder, filename mask, file-content match. It’s gone.

    I took my Vista machine to Best Buy today and for $129 they assure me they’ll get it properly upgraded to XP. I wish I had time to do it myself.

    -Ron

Leave a Reply