G
Guest
Hello.
I need to search for a text value in all files within a directory that has
sub folders.
I want to create a batch file to do this but have no idea how to do it.
I know I need the DIR /AD command that I can then use as a pipe to the
"Find "something" *.* > MyResults.txt".
I would like to pass in two arguments. 1st: path to my directory e.g. c:\temp.
2nd: what to search for.
The batch file should look something like this:
Rem Start of batch file
cd %1
dir /ad > MyDirs
for %%i in (MyDirs) do
cd %%i
find %2 *.* > C:\temp\MyResults.txt
Any help will be greatly apporeciated!
Rita
I need to search for a text value in all files within a directory that has
sub folders.
I want to create a batch file to do this but have no idea how to do it.
I know I need the DIR /AD command that I can then use as a pipe to the
"Find "something" *.* > MyResults.txt".
I would like to pass in two arguments. 1st: path to my directory e.g. c:\temp.
2nd: what to search for.
The batch file should look something like this:
Rem Start of batch file
cd %1
dir /ad > MyDirs
for %%i in (MyDirs) do
cd %%i
find %2 *.* > C:\temp\MyResults.txt
Any help will be greatly apporeciated!
Rita