Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Another life ago I used to build PCs, but have been a Mac girl for so long now... this question is almost embarrassing but it's driving me nuts.

I'm using command prompt findstr to search website contents for a particular call: findstr /I /S /P "search string".

My question, though, is how to tell if it's working? Whenever I execute this command it never seems to go anywhere or pull any results, 0 or otherwise. It won't let me do anything else (like dir or CD) so I assume it's working, but no matter how long I wait nothing happens.

Is there any way to tell where in the search it is or how long it might take?

share|improve this question
/S searches for matching files in the current directory and all subdirectories. If you have a lot of files in those directories, that's going to take a long time. A very long time. Also, that won't search the contents of a website, unless you downloaded the website contents beforehand and placed them within the current directory (or a subdirectory). – Bob Mar 26 '13 at 17:01
The way to test this kind of thing is to create a small text file that contains you string and see if it works there. If it hangs with a 3-line text file, you know something is wrong with the command. – terdon Mar 26 '13 at 17:01
@terdon the /S option, in effect, specified the files to search. Which can be a heck of a lot. Even if searching only within the user profile, that can easily be gigabytes of data with tens of thousands of files. Don't even think about doing that in the drive root in any reasonable amount of time. – Bob Mar 26 '13 at 17:03
This is the wwwroot directory of a web server and we are currently doing penetration testing. We found some security holes so I am trying to find all html documents that call this particular file to find all pages that need to be fixed. So yeah, the directory will have a lot of files to scan. – kristina childs Mar 26 '13 at 17:04
@kristinachilds How long have you waited? This should just print results as it finds them. Blank is supposed to mean it's searching. (Personally, I like Notepad++'s find when searching for text in files in a directory.) – Bob Mar 26 '13 at 17:16
up vote 1 down vote accepted

If I understand the findstr documentation correctly, you can also specify which files to search in. That should speed things up (searching only *.html) and so should telling findstr to only report matches (/m) rather than printing each matching line. I guess the /m flag will cause findstr to exit as soon as the first match is found so it won't need to process the entire file. Something like this:

findstr /I /s /p /m "search string" *.htm*

I used /s and /p because I could not see /S or /P in the documentation and guessed that is what you meant.

To check it is working, either run it on a small file as I suggested in the comments, or create an html file that contains your string in the same directory you are launching the command from. That way, it should report that it found that one very quickly and you will know it is working.

share|improve this answer
Thanks, I will try this. I looked over the documentation but didn't see if there was a way to do multiple filetypes. Do you know offhand if there's a way to do that? Like *.htm* *.asp *.php *.inc etc? – kristina childs Mar 26 '13 at 17:41
Nope, no idea sorry. I've never really used the windows command line. Can't you get access to these directories on a Mac or Linux system so you can use some standard UNIX tools? I can see various ways of making this easy on *nix but my windows-fu is pitifu(l). – terdon Mar 26 '13 at 17:45
unfortunately this is on a windows server, so i'm limited to the windows os tools. not my decision, but it is what it is. – kristina childs Mar 26 '13 at 17:52
I know, I was just thinking of whether you could access it over Smb or something. I feel your pain, I hate being forced to work without my preferred OS. – terdon Mar 26 '13 at 17:56
Yeah. I'm no OS fundamentalist... they each do some things better than others. But when it comes to website administration, Unix tools are far superior. I hate working on windows servers. Bleh. – kristina childs Mar 26 '13 at 18:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.