This is due to the What to search setting in Windows Explorer under Folder Options -> Search as pictured below.
If you don't have Always search file names and contents selected Windows will only search the files it has indexed.
You can change the setting using the UI as shown above but you can also set it by changing the following Registry setting (which is useful if you want to programmatically set if for users):
Originally I tried to change the following key based on Scott Forsyth's solution for Windows XP and Windows Server 2003 but it didn't work for me on Windows 7:
As a bonus tip, this is how I found where the Windows 7 registry key was.
- Open Registry Editor
- Right click the registry hive you suspect the setting to be in (usually either HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE) and select Export and save the .reg file (ex: hklm1.reg)
- Change the setting via normal means.
- Repeat steps 2 and 3 and save the file with a new name (ex: hklm2.reg).
- Use a Diff tool such as the one include with Tortoise SVN or Tortoise Git to search for changes.