Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to search only a subset of folders in visual studio? I would like to find all instances of

console.log in my code. But, I don't want to search 3rd party *.js files.

share|improve this question
up vote 1 down vote accepted

I'm not sure of Visual Studio, but I always keep a copy of Notepad++ handy when searching for something in multiple files. Are your 3rd party javascripts all contained in a vendor folder or something? If you're not doing tier 3 development, move the javascript folder off to your desktop or something, perform the search/replace and then move the folder back.

share|improve this answer

This functionality was requested as a feature addition to Visual Studio and can be seen in this Microsoft Connect issue.

Unfortunately, the issue was closed as "Won't Fix", but a few workarounds exist (albeit with a few more steps required):

Perform the steps listed as the workaround within the Microsoft Connect issue:

Although VS doesn't currently have a context menu item for 'search only in this folder,' it is possible to scope your Find and Replace searches to a given folder. To do this, bring up the Find dialog, choose Find In Files or Replace in Files (not Quick Find or Quick Replace), and click on the '...' button next to the "Look in:" dropdown. This should bring up another dialog that allows you to choose a specific folder or set of folders for your search.

Or do what I do, which is very similar:

  • Right-click on the folder you wish to search in.
  • Select the "Open Folder in File Explorer" option which opens Windows Explorer at the specified location.
  • Copy the full path from Windows Explorer's title bar to your clipboard, then close Windows Explorer.
  • Back in Visual Studio, open up the Find & Replace dialog, and paste in the copied path to the "Look in:" textbox in the dialog.
share|improve this answer
+1 Even if there are a couple of steps to achieve the goal, it's look like a good solution considering that we usually not searching by folder 100 times a day. – Samuel Apr 21 '15 at 14:19

In notepad++ you must open all files. An alternative would be Windows Grep ( You can replace in all files in a subset of extension using regular expression.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .