Bert Vierstra Blog

Bert Vierstra Home

   
Ad

May 17, 2005

Previous : Internet Marketing in Bali    Next : Happy and Proud

Windows XP Explorer Search in PHP files

Filed under: PHP Stuff, Windows XP — Gede @ 8:50 pm

Are you a php programmer? I loose code all the time, and the first thing I do when I have installed a fresh copy of Windows XP, is make Windows XP believe PHP files are searchable text files. In its standard configuration XP does not search within files it doesn’t know, like *.php files….

Use this little registry entry:

REGEDIT4

[HKEY_CLASSES_ROOT\.php]
@="txtfile"
"PerceivedType"="text"
"Content Type"="text/plain"

And Windows XP Explorer searches for those very important lost code snippets and text fragments in your local web server directory….

The same trick works for .htm and .html

You know what to do….

UPDATE

After some research it seems that the trick is add a persistanthandler to a file type…

Even Microsoft mentions this here:

Search word or phrase in a file

So, this registry entry would do the trick:

[HKEY_CLASSES_ROOT\.php\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.phps\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.php3\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

My guess is that it works for all text containing file types……….

5 Comments

  1. Thanks - this is exactly what I need.

    I would appreciate very much if you would explain what to do with @=”txtfile”

    Also, is there something significant about the 4 in REGEDIT4?

    Comment by Kris — June 19, 2005 @ 4:53 pm

  2. @=”txtfile” don’t really know…

    The 4 ? I guess just a version indicator, maybe tells regedit how to handle syntax or something…

    Comment by Gede — June 19, 2005 @ 5:15 pm

  3. Thanks, but I am still unable to search for code within PHP files without opening each one.

    This is what I now have under PHP in Registry:

    (Default) REG_SZ ft000002
    Content Type REG_SZ text/plain
    PerceivedType REG_SZ text

    What more do I need to do?

    Comment by Kris — June 20, 2005 @ 6:02 am

  4. Try adding this:

    [HKEY_CLASSES_ROOT\.php\PersistentHandler]
    @=”{5e941d80-bf96-11cd-b579-08002b30bfeb}”

    and restart….

    Comment by Gede — June 20, 2005 @ 9:00 am

  5. Thanks for pointing me to the Microsoft support site. This is what worked for me:

    Method 2
    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.

    http://support.microsoft.com/default.aspx?scid=KB;EN-US;309173

    Comment by Kris — June 22, 2005 @ 6:47 am

Leave a comment

You must be logged in to post a comment.




Categories:

Random Thoughts
Web Observations
Web Activities
Digital Camera Department
PHP Stuff
Internet Marketing
Windows XP
Mobile Phones
Panorama Pictures


Archives:

June 2007
September 2006
May 2006
February 2006
October 2005
July 2005
June 2005
May 2005


My Sites

Bali Web Home
BPI Properties in Bali
Bali Hotels Lovina
Panotools 360
Bali News and Info
Lovina Bali Spa
Bali Golf House
Bert Vierstra
Malaysia Pictures
de Praktijk




Login



XML Feed

RSS






- Bali Web Design Indonesia -

The Web Writers Writings - WordPress -