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.

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.

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.

January 29th, 2008 at 9:16 am
Your suggestion does not work.
Having a white form with white boxes is pretty dumb.
February 8th, 2008 at 12:34 am
Sorry what do you mean?
March 18th, 2008 at 11:04 am
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!!
March 26th, 2008 at 12:43 pm
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.
April 7th, 2008 at 4:40 am
You didn’t help me, in fact, its not working… Should test yourself before publish…
April 8th, 2008 at 10:17 pm
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)
April 18th, 2008 at 11:33 am
Would any one know how to get Vista search tool to search for text inside of a script tag in a .aspx file?
April 18th, 2008 at 1:43 pm
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.
April 22nd, 2008 at 8:53 am
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…
April 22nd, 2008 at 9:10 am
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.
April 26th, 2008 at 10:41 pm
Hey,
Thanks for posting this. It confirms that I’m NOT crazy, VISTA SUCKS.
Bring back XTree.
May 3rd, 2008 at 12:01 am
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.
May 7th, 2008 at 2:46 pm
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
May 7th, 2008 at 11:07 pm
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).
May 18th, 2008 at 11:40 pm
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.
May 19th, 2008 at 4:56 pm
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?
May 29th, 2008 at 10:45 am
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.
June 10th, 2008 at 8:15 am
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?
June 12th, 2008 at 3:36 pm
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
June 14th, 2008 at 9:05 am
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?
June 21st, 2008 at 7:46 am
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
July 11th, 2008 at 9:31 pm
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?
July 18th, 2008 at 7:49 am
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
July 31st, 2008 at 6:03 am
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”
July 31st, 2008 at 2:19 pm
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
August 17th, 2008 at 12:53 pm
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).
August 19th, 2008 at 9:35 am
^^ 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.
September 8th, 2008 at 2:44 pm
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.
September 8th, 2008 at 8:36 pm
Why did you go edit your registry?
September 8th, 2008 at 10:30 pm
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.
September 16th, 2008 at 6:12 am
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.
October 3rd, 2008 at 10:23 pm
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!
October 3rd, 2008 at 10:57 pm
Oh sorry I did not read Morris’ post properly. I have tried it however, and receive a VBscript error.
October 9th, 2008 at 2:23 pm
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 …
October 10th, 2008 at 12:37 am
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
November 5th, 2008 at 9:52 pm
$129?!? Probably the best 129 bucks you’ll ever spend! ;-p
November 7th, 2008 at 1:45 pm
In Vista, to search the contents of a file, use:
contents:[whatever you are looking for]
For example, if you are looking for a file containing the exact string “My Home”, use:
contents:”My Home”
If you are looking for a file that contains both the words “My” and “Home”, but not necessarily together, use () around it:
contents:(My Home)
Hope that helps
November 10th, 2008 at 10:53 am
I can’t believe VISTA complete hobbled an awesome search feature. Gone are the days when one could right click a folder, choose search and specify all *.txt, *.doc that contain “cat” which were modified and/or created within a specific time frame.
The Vista search is useless as are the suggestions on this page for fixing it. I simply cannot beleue that a SP or fix has not been pushed to us giving us the option of the wonderful searches in XP and 2000.
Whata waste is an extremely useful function that I used practically every day.