Customize how Find in Files results are displayed in the Find Results Window

Keyboard:  CTRL + SHIFT + F
Menu:  Edit -> Find and Replace -> Find in Files
Command:  Edit.FindinFiles
Versions:  2008,2010
Published: 1/3/2010
Code:  vstipFind0002 




You can customize your Find in Files results to show what you want to see and how you want to see it.

Example:  You don't want to view the entire file path shown in the Find Results tool window.

So instead of this:




You want this:



No problem! 🙂


DANGER:  This involves hacking the Registry so use this tip at your own risk!

  1. Open up RegEdit
  2. Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Find
  3. Add a new string called Find result format with a value of $f$e($l,$c):$t\r\n

  4. Hop into Visual Studio and run a Find in Files search (NOTE: You do not need to restart VS to see the changes made in the Registry, which is great for testing different string combos)


Here are valid values you can use in the string:



$p      path                       

$f      filename               

$v      drive/unc share            

$d      dir                        

$n      name                       

$e      .ext                   



$l      line                        

$c      col                        

$x      end col if on first line, else end of first line

$L      span end line

$C      span end col


$0      matched text                

$t      text of first line

$s      summary of hit

$T      text of spanned lines


\n      newline                   

\s      space                     

\t      tab                        

\\      slash                    

\$      $                 

Comments (19)

  1. Some guy says:

    Great tip, works beautifully in VS2008 !

    FYI, discovered this blog by searching for "visual studio" rss feeds on

  2. John says:

    The problem with this is that $d gives you the entire directory path (minus the device). So, your choice is between no directory information, or the entire dir path.

    What people with multiple projects would want is JUST THE LAST FOLDER of the directory path (the actual project folder). That is, the folder containing the file, as well as the file.

    So what is needed is a way to substring the $d value.

    I tried "$d[74]" (to start with the 74th character). Put it just appended "[74]" to the path string. Not terribly useful.

    Maybe some brilliant soul can figure out how to substring $d string. THEN this would really be useful!

  3. Jason Vogel says:

    Great tip Zain – will really come in handy when using VS on a laptop screen.

  4. Anonymous Coward says:

    While it's changed slightly for 2010, this is plagiarized from…/customize-your-find-in-files-results-experience

  5. zainnab says:

    Anonymous 🙂

    Actually it's taken directly from Sara's previous work.  Sara turned over the Tips to me and we are, in fact, writing a book together on the topics as well.  Just FYI.


  6. Different Anonymous Coward says:

    Can you do the same for the "Bookmarks" window?  

    The "File Location" field can get very long, especially if you have your project/source in a sub-directory of your "My Documents".

    MSVS 2010 Pro

    Sorry if repeated

  7. ca martin says:

    PATH ->$prnRESULTS ->$f$e($l,$c):$trnrn

  8. zainnab says:

    DAC 🙂

    Sadly, no.  I am not aware of any other tool window that has this level of control.  


  9. zainnab says:

    ca martin,

    cool!  I'll try it. 🙂


  10. Aquaren says:

    Is there any way to sort the results?

  11. zainnab says:

    Aquaren 🙂

    Not that I am aware of short of putting them into Excel or some other tool.


  12. says:

    This is a really nice feature, does there exist a possibility to output several findlines ?

    My usecase is to find some text with a regular expression which covers several lines of code, it would be nice to have all of them in the findresult

  13. Nick says:

    This feature seemed to disappear in VS 2012. Is there a known alternative?

  14. Stephan Hodges says:

    Works fine in VS 2013 (which is 12.0 in the registry)

  15. says:

    Is there any way to make this work with the Find Symbol Result window ?

    It seems to be almost exactly the same type of window but the format string is not applied.

  16. DeeGee says:

    I tried it in VS 2013 and it did not work. When VS loads it deletes the Find result format string.

  17. remember ascii screens? says:

    since the font is mono width, tabs can help.

    in lieu of table flexibility, i went for:

     "how can i scan the results quickly?"

     "give me some white space too"

    I scan by:

    .ext, file-name.ext (line#), code, and finally file path (seen but not heard)

    $ett$f$e ($l)ttttt$tttttt$dn

    it's not perfect, but it definitely speeds up things for me. 🙂

  18. zzz says:

    Да какой мудак придумал вынести настройки результата поиска в реестр?

  19. Hannibal says:

    This is amazing.

    Just confirmed that it works in Visual Studio 14.0 as well.

    Thanks a lot!

Skip to main content