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

Per this answer I was attempting to use findstr to locate a string (a name) inside some HL7 log files in a directory. Findstr was getting 0 results, but Find returned plenty. I played around with the syntax of my findstr command, but couldn't get it to return a result. Note, as these are HL7 files, the name is surrounded by symbols (|, ^, etc.):

D:\logs>findstr /l /m /c:"Test" *.*


I assume the lack of output means 0 results. Meanwhile:

D:\logs>find /c "Test" *.*

---------- LOG1.LOG: 0

---------- LOG2.LOG: 4

---------- LOG3.LOG: 0

---------- LOG4.LOG: 0

---------- LOG5.LOG: 8

---------- LOG6.LOG: 0

---------- LOG7.LOG: 18

So there are plenty of results. Why didn't Findstr find any files?

share|improve this question
Can you post a sample of the log file so that I can reproduce? – djangofan Aug 17 '12 at 20:47
@djangofan I'm having issues ginning up fake files for some reason. Making a small text file with the bare minimum of what I think is a sufficient simulation (e.g. "|Test^Foo") ends up working with findstr. – Keen Aug 17 '12 at 21:12
I think with those special characters, like '^', you need to enable delayed expansion in your script. This script is an example I made that uses both FIND and FINDSTR.exe :… . – djangofan Aug 20 '12 at 17:34

Your Answer


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

Browse other questions tagged or ask your own question.