What is the fastest (accurate) way to search for a string of text in files on a Windows machine?

As the title suggests, what's the fastest (accurate) way of finding which lines of which files match a particular string.

Specifically, I'm searching .cpp and .h files.


Notepad++ has 'find in files' option, which is located in the 'Search' menu.. This will allow you to search multiple files in a folder (you can specify the folder) and will show you the line numbers of each file as well. You can toggle whether subfolders and hidden folders are included in the search, and it will also allow you to search with \t \n etc. and to search with regular expressions if you need.

Notepad++ is a Windows programmers editor (not an IDE) and is Open Source too.

(i realise that you have most likely heard of notepad++, but I'm just mentioning it here as an option incase you were unaware of this particular feature, and for others who stumble across this thread later on.

Cheers :)


Agent Ransack works like a charm. Download it here.


Findstr always works for me. It can use text * wildcards or regex for the search string. Findstr /? for more


On Unix systems people would most likely use grep to do this, so why not use Windows Grep?

http://www.wingrep.com/