Windows XP Search doesn’t work when using the “Word or phrase in a file” option

Have you ever used the Windows search facility to look for words embedded in the files and not got back the results that you expected?
 
I have… all the time…
 
Most recently I have started development on an existing PHP application (1046 undocumented PHP files).  In order to get an understanding of the application I have been searching the source files to find out where certain functionality is utilised…
 
So I have a PHP class called dbconnection and I want to find all the places that it’s been referenced. 
 
So… browse to the root directory and select Search – All Files and Folders and in the “Word or phrase” box I type dbconnection.  Hit the Search button… Nothing… hmm now I don’t know how many files I was expecting, but none is clearly wrong, there is at least one where dbconnection is defined!
 
To cut a long story short… this is a feature of Windows XP… Microsoft say…
 
“In Microsoft Windows 2000 and earlier versions of Windows, all files are searched for the content that you specify. Windows XP does not search all file to enhance the performance of searching and to avoid extraneous results. This behavior occurs whether or not you use the Indexing service when you search.”
 
The solution that worked for me was…
 
To configure Windows XP to search all files no matter what the file type, obtain the latest service pack for Windows XP and then turn on the Index file types with unknown extensions option.
 
If you use this method, Windows XP searches all file types for the text that you specify. This can affect the performance of the search functionality.
 
To do this:
  1. Click Start, and then click Search (or point to Search, and then click For Files or Folders).
  2. Click Change preferences, and then click With Indexing Service (for faster local searches).
  3. Click Change Indexing Service Settings (Advanced). Note that you do not have to turn on the Index service.
  4. On the toolbar, click Show/Hide Console Tree.
  5. In the left pane, right-click Indexing Service on Local Machine, and then click Properties.
  6. On the Generation tab, click to select the Index files with unknown extensions check box, and then click OK.
  7. Close the Indexing Service console.
This solution and other relating information is available here… http://support.microsoft.com/kb/309173 
 
 
 
Advertisements
This entry was posted in Computers and Internet. Bookmark the permalink.

6 Responses to Windows XP Search doesn’t work when using the “Word or phrase in a file” option

  1. Unknown says:

    Thankyou! This fixed my problem too.

  2. Jevgenijs says:

    Doesn\’t work for me. Most likely because I have Windows XP SP2 which is not the latest service pack.Does Indexing Service need to be started/stopped?For me it doesn\’t work anyway… ?!

  3. JT says:

    THANK YOU!!! that fixed it for me too

  4. JC says:

    Thanks for this – it worked!

    Why can’t Microsoft put an understandable answer to this problem in their help (or actullay just fix the problem)?

    • CoastalCoder says:

      Glad this worked for you, I think it’s a case of the default behavior not being what the user would expect, but what the vendor thinks would be good. A bit like buying a satnav that by default only has places that the manufacturer things might be nice to visit… but you can have all places if you realise and know how to change the settings…

  5. lengoforth says:

    Didn’t work. Well, it worked the first time, but not on subsequent searches. I had to resort to Microsoft’s fix, ‘change the persistantHandler Key under HKEY_CLASSES_ROOT for .m3u files. To see how, visit the micorsoft link you provided and see Method 1.

    Thanks for your guidance, though! Without your help, I would have spent a lot longer figuring out how to find .m3u files that contained specific artists or song names. I send a big hug!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s