The built-in Windows Search tool will apparently not search within PHP files. I cannot find the files named *.php containing text "some_function_name" that I know are there.

Search is complete. There are no results to display.

What's a good alternative to the built-in "Search for Files and Folders" tool in Windows?

Search for Files and Folders

link|improve this question
feedback

migrated from stackoverflow.com Apr 28 '10 at 5:13

This question came from our site for professional and enthusiast programmers.

20 Answers

findstr /s [string] [files]

findstr /? for more information, including the regex syntax you can use.

link|improve this answer
An example of usage would be: c:\> findstr /s /I /C:some_function_name" *.php /s is recursive search, /I is case-insensitive, /C is the string to look for. – Joe Pineda Sep 30 '08 at 20:58
Forgot to mention I find DOS' findstr to be much faster than Windows Search, and cares nothing about the extension type. – Joe Pineda Sep 30 '08 at 20:59
feedback

To get Windows Search to search all file types use Chris Sells' .reg file ("Filter Files With Unknown Extensions For XP")

link|improve this answer
feedback

I use the free version of Agent Ransack. It lets me use regular expressions and shows me the lines of the file that match.

link|improve this answer
+1 for Agent Ransack - been using this for ages. I also like that you can regex filter the filenames as well – Shevek Apr 28 '10 at 7:27
Can it index removable media? – Kenny Evitt Dec 26 '11 at 0:19
feedback

Install Cygwin. Use grep. You also get the benefit of all the other cool Linux tools like vim and sed that will make your life easier and increase your productivity.

link|improve this answer
feedback

Google Desktop. There's an addin that is great for text based files.

link|improve this answer
sadly, this has been discontinued - though I would've upvoted this answer when it was still active! – warren Feb 28 at 14:20
feedback

Windows Grep - an excellent tool on Windows.

link|improve this answer
feedback

You can tell Windows Desktop Search to look in PHP files. It also doesn't look in CS files by default.

Go to Control Panels > Indexing Options > Advanced > File Types tab. On the bottom of the form, enter "php" and click "Add New Extension". Set the type to "Index Properties and File Contents".

link|improve this answer
feedback

Ack is a pretty nice command line tool implemented in Perl.

link|improve this answer
feedback

Copernic Desktop Search is good. Same functionality as Google desktop search, but some people don't like the way GDS phones home. Unfortunately there was an app it didn't play nice with on my work machine, so I had to uninstall it.

link|improve this answer
feedback

I haven't seen anyone recommend Copernicus yet.

link|improve this answer
Copernic, not Copernicus – Roddy Sep 30 '08 at 22:04
feedback

If you have Notepad++ or Dreamweaver, they'll do that for you.

link|improve this answer
feedback

To search for files based on its contents I use Notepad++. Most of the time I already have it open anyway.

link|improve this answer
feedback

Try Spectate Swamp Desktop Search. That will fix you right up.

link|improve this answer
feedback

I don't have any trouble searching in PHP files on my Windows XP machine. It must be some strange setting excluding PHP files maybe. There is a shareware program called WindowsGrep that works pretty well.

link|improve this answer
feedback

You can just modify Windows XP to search ALL textual files for text. See Windows XP Search Bug.

link|improve this answer
feedback

Have you tried using grin? It's a command-line program written in Python. It runs under Windows, Cygwin, Linux, etc.

link|improve this answer
feedback

Try Everything. It seems to work pretty well and is free.

link|improve this answer
Everything generates indexes for faster searching, but it doesn't index the contents of files, it only indexes file and folder names. – Kenny Evitt Dec 26 '11 at 0:14
feedback

Placer Search & Replacer searches PHP files and other files. It is pretty lightweight and fast.

link|improve this answer
feedback
dir /s *.php

Execute that in the directory you want to find stuff in and in subfolders.

link|improve this answer
1  
I don't have 100 to downvote you , but this doesn't answer the poster's question. – sep332 Nov 6 '08 at 17:47
feedback

I try to load up all .php files in Notepad++ and search from there. However, when I don't know where to even start to look, I use FileSearchEX.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.