Winhelponline.com - http://www.winhelponline.com
Using the "A word or phrase in the file" search criterion may not work for HTML files
http://www.winhelponline.com/articles/125/1/Using-the-A-word-or-phrase-in-the-file-search-criterion-may-not-work-for-HTML-files.html
By Ramesh Srinivasan
Published on January 25, 2007
 
When I search for a specific text inside .html files, the Search Results shows only 2 files. I enter *.html for Search for files or folders named, and I typed src= for Containing text field. "Look in" shows the folder I originally selected.

Using the "A word or phrase in the file" search criterion may not work for HTML files

Symptom

When I search for a specific text inside .html files, the Search Results shows only 2 files. I enter *.html for Search for files or folders named, and I typed src= for Containing text field. "Look in" shows the folder I originally selected.

Under Search Options, Date, Type, and Size are not checked. Under Advanced Options, only Search Subfolders is checked. When I click the Search Now button, the results show only two files. I know I have over 200 HTML files in this folder that contain at least two instances of the text src= in each such file. I get similar incomplete results searching for other text strings in these files.

Resolution

Windows XP uses the HTML filter (nlhtml.dll) for HTML file types, which ignores comments and other tags in HTML files when searching. To circumvent the problem, you may use a plain-text search filter rather than default HTML search filter. To do so, use the following steps:

  • Click Start, Run and type Regedit.exe
  • Navigate to the following key:

HKEY_CLASSES_ROOT\.html\PersistentHandler

  • Backup the key by exporting it to a REG file
  • Double-click (Default) and set its Value Data to {5e941d80-bf96-11cd-b579-08002b30bfeb}
  • Close Registry Editor.

You may repeat the above steps for .htm file types (the following branch) if you want:

HKEY_CLASSES_ROOT\.htm\PersistentHandler

Note: You may need to restart Windows, or logoff and login back to your account, for the changes to take effect.