Solved

Search for a string in any file in a specified directory

Posted on 2013-01-23
4
287 Views
Last Modified: 2013-01-29
Hi,

I need to search all files in a specified directory that contain a string 'test string'.  It needs to search all sub directories etc.   Then the results need to give me the path and filename of all the files that contain that string.

Is that possible?
0
Comment
Question by:elwayisgod
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38810653
Do you really need VBScript for this? The findstr command does this already.

e.g.

findstr /s "to find" *.*

Open in new window

0
 

Author Comment

by:elwayisgod
ID: 38810683
NO.  I will take VB or Dos doesn't matter.  I'm trying to manually find this directory referenced in files but there are way to many.......
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 38811368
FINDSTR a good tool to give a try.  You can do FINDSTR /? at a command line to see the various options (like /I to ignore case, etc).

Sounds like you might want the /M option to just get a list of the file names, not all the hits.

~bp
0
 
LVL 9

Expert Comment

by:shorvath
ID: 38816371
Freeware solution

http://www.mythicsoft.com/page.aspx?type=agentransack&page=home

been using this for years....
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question