Ik_guy

Geekskillz_logo1


"Everything that boots is beautiful."


Sep 15
2007

Windows Search For All Files

Tags: Programming   Rants


Here's a tip that programmers might appreciate. Coders dealing with huge projects rely on search quite a bit, especially when they need to make project-wide changes.

Say you use a function named do_something_that_crashes(). At some point in time you may need to find all instances of that function and remove it. It could be in dozens of files. Hundreds even!

On UNIX or using cygwin, you could find all files containing that function using the find command. On a Mac, it's even easier: you just use Spotlight (with plugins like this one). Why can't every operating system have Spotlight?? On Windows, you have the crappiest search capability of any operating system: that stupid orange dog that couldn't find a dead bird to save his life.

The problem is that Windows search ignores files with extensions that it doesn't understand. So, if you're a web programmer trying to search through all your .php files, Windows won't be able to do it. Ruby on Rails programmer? Windows will ignore all your .rb, .rhtml, and .rxml files. And even better, it will make it look like it searched them but didn't find anything! It will proudly say, "Nope, those files don't contain what you're looking for." You can easily test this. Open one of your files, choose a word that you find in the file, and then tell that inept Windows search dog to find the word in the file. It will happily tell you that the file doesn't contain that word. Your eyes deceive you! Trust Windows!


This problem isn't limited to programming language files. It could affect anyone who doesn't use Microsoft software, or file types that Microsoft doesn't care about.

Well, I found a Microsoft Support article that tells you how to fix this problem. You can tell Windows to look in every file, even the ones that Windows would rather ignore. You are warned that this will slow down Windows Search, because it means that Windows Search will actually be doing what you asked it to do! Wouldn't you rather that the search finish immediately and give you no results? I mean, why would you want to wait 30 seconds only to find what you're looking for?

Windows XP instructions:

1. Click Start, and then click Search.
2. Click Change preferences above the dog's ugly face, and then click With Indexing Service (for faster local searches).
3. Click Change Indexing Service Settings (Advanced).
4. In the "Indexing Service" window that pops up, click the third icon from the left with the tooltip that says Show/Hide Console Tree.
5. In the left pane, right-click Indexing Service on Local Machine, and then click Properties.
6. Yet another window will pop up. On the Generation tab, put a check mark in the Index files with unknown extensions check box.
7. Click OK. It is now done.
8. Close the "Indexing Service" window.

Here's an optional set of instructions, which is preferable for web programming:

1. Go buy a Mac.
2. Use your Windows PC for playing games.






StumbleUpon This! Bookmark This Article Digg This Story

  Shuva, on Tuesday, September 25, 2007 at 10:48 Eastern Daylight Time:
Thanks for this post. I was so far thinking that their Search is fundamentally broken with so many bad experiences. I have cygwin installed and always use the find and grep command to search files on my Windows desktop.


Post a comment:

Name:
E-mail: (will not be sold or published)
Website: (Optional)

Your comment:

Are you human?
Please enter the
text in the picture:


About Me

ThinkGeek

Feed-icon Technorati


Loot For Geeks:
4inkjets Great Prices and Best Quality!
Man's Wig! All size heads! Handsome! Sideburns! Modacrylic Fiber!
Protection
!
Make money online selling grit! Famous men sell grit!