Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Search for a string in any file in a specified directory

Posted on 2013-01-23
4
Medium Priority
?
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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 57

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

705 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