I can't find any .txt, .php, .cs, .html, etc files using the 'search by file content' option in the searchbar in Windows Server 2012 R2.

I can't find the File Service Role.
I can't find the Windows Search service in Services.
I have checked the advanced option "File content".

  • You are right!.. is there anyway i can move it? a simple way?
    – Fraga
    Commented Jan 28, 2014 at 7:59
  • I am not sure that a user can, but we can ask a mod to help us out.
    – Tommy
    Commented Jan 28, 2014 at 11:02

5 Answers 5


I decided to provide screenshots, as Windows Server features and roles are now in a single interface and it's not obvious where to look.

Step 1. Enable Windows Search Service feature

Step 2. Enable search in contents

  • @Ramhound thanks for your review. I've updated the post text Commented Feb 10, 2017 at 13:15
  • In which case why not just update the answer with the images rather than leaving a duplicate answer?
    – user692942
    Commented Apr 10, 2017 at 8:34
  • 1
    @Lankymart Does one get points for up-votes on an answer that one only edits rather than posts? I found the screenshots much more helpful than the original answer, which I had already found.
    – BlueMonkMN
    Commented Sep 20, 2017 at 13:56
  • @BlueMonkMN no, but if that's the end-game with answering, then the StackExchange communities are not for you.
    – user692942
    Commented Sep 20, 2017 at 14:00
  • 1
    @Lankymart The purpose of assigning points is to give proper incentives for desired activities. So of course the scoring of answers should be considered in explaining why people choose a particular course of action. Whether that's one's ultimate motive shouldn't matter much otherwise there's little purpose in assigning points in the first place. Even if points aren't this answerer's motive, I think it's important for them to see how much the screenshots mattered. I suppose this should be discussed on meta.superuser.com instead of here. If another reply is warranted, maybe I'll take it there.
    – BlueMonkMN
    Commented Sep 20, 2017 at 14:19

In the explorer menu

View -> Options -> Change Folder And Search Options
Folder Options -> Search -> Check Always Search File names and Contents ....
  • 3
    Also check that you have the Windows Search feature installed (in Server Manager). And then check which locations are indexed in File Explorer > Search > Advanced Options > Change indexed locations
    – bounav
    Commented Jun 6, 2014 at 11:08
  • 2
    @bounav - Of course, look at File Explorer > Search > Advanced Options because that's the obvious place to find the configuration for windows search. Not. Thanks!
    – davidbak
    Commented Mar 25, 2016 at 3:36

findstr /S /L /M /C:"DocumentImportClass" .

search file content into folder and sub folders in windows


1+ for Vikash's command.

I would also add that /I to make it case-insensitive

findstr /S /L /M /I /C:"TextToSearch"


The easiest way that worked for me was to select all the files where you suspect the string to be present, then right click and select open with notepad++. Once all the files are open in different tabs, go to any file tab and do Ctrl+F, type your string and select Find All in All Opened Documents and there you go!

You must log in to answer this question.