Search in File Contents in Windows

Problem

By default, Windows will not search the contents of certain file types. This makes it very frustrating for anyone trying to locate the occurrence of words or phrases within a group of files.

A Few Details

First off, I am running Windows 7 and since I am a PHP developer, the solutions I provide will allow you to search the file contents of PHP files. However, this should work for other file types that Windows has trouble searching within.

A while back, I solved this problem and was able to search for text inside of PHP files but that was when I had Windows Search Indexing enabled.

Now, I’ve installed a fresh copy of Windows 7 and disabled Search Indexing in hopes of improving my system’s performance. To get this to work it requires you make a few minor changes to the Registry but please use caution when doing so. Incorrect changes to the Registry can cripple Windows.

Solution

  1. Press ‘WinKey + R’ and type regedit then hit ‘Enter’.
  2. Expand the ‘HKEY_CLASSES_ROOT’ list and scroll down until you see ‘.php’.
  3. Right click on ‘.php’ and select New >Key.
  4. Rename the newly created key ‘PersistentHandler’.
  5. With the ‘PersistentHandler’ key selected, set the value of (Default) to
    {5E941D80-BF96-11CD-B579-08002B30BFEB}‘ without the single quotes.
  6. Exit out of the Registry.
  7. Restart your computer.

The end result will look something like this…

Search in File Contents

One thought on “Search in File Contents in Windows”

Comments are closed.