Solved

Search for a string in any file in a specified directory

Posted on 2013-01-23
4
285 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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

861 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now