Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find File By Looking In Contents 2

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
0
0
US
Hello,

In Windows 95/98/NT/2000 if I want to find a file by specifying a string that is inside the file it works no problem. With Windows XP it NEVER works for me and I am uncertain why.

Example session used that does not find a file but will on earlier OS's:
Code:
1. Right-Click on directory.
2. Select Search
3. Any or part of the file name: [b]*.html[/b]
4. A word or phrase in the file: [b]body[/b]
5. Select Search button

What can you recommend?


Thanks,

Michael42
 
If you're just running this from your machine try out


I haven't toyed much with the search options in XP but I have read, in several instances, where the option struggled finding files if the search went beyond the name. I don't know that this applies here, but see what happens with ransack.
 
Notes from Kelly Theriot:

Windows® XP has a known issue for not finding a number of File Types when you do a Search for Files "containing text" or using the "A word or phrase in the file" option. This can be remedied for many file types, but not all.

Download the VBS file below. Double click the file you just saved. You'll be prompted to enter a file extension. If the PersistentHandler value is correct, no changes will be made. If the PersistentHandler value exists, but is different, no changes will be made. If no PersistentHandler value exists, then it will be created.

Enable XP's Search to find text in files:

Manual Edit:

To resolve this problem for other file types, install a program that registers a filter for the file type that you want to search. If no program that provides a filter is available, you can use the plain text filter for a file type.

Go to Start/Run/Regedit and add a PersistentHandler key under the file type key in HKEY_CLASSES_ROOT and set its (Default) string value name to the following value: {5e941d80-bf96-11cd-b579-08002b30bfeb}

For example, to use the text filter provider for .pas files, the following registry setting should exist:
HKEY_CLASSES_ROOT\.zzz\PersistentHandler\(Default) = {5e941d80-bf96-11cd-b579-08002b30bfeb}

After you add this value to the registry, you must log off and then log back on to make the change take effect.

Using the "A Word or Phrase in the File" Search Criterion May Not Work
 
bcastner,

That did the trick. Thanks for posting.

-Michael42
 
I had posted about this in another thread. The xp_persistanthandler worked. Very helpful, bcastner, thanks very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top