Batch File to Search and Copy Results
Posted: 01 Jun 2010 13:12
Hi,
I want to be able to do a search within a directory and then copy the results into both
1) A text file
2) Copy the found files into a new directory
So far this is what I have:
------------------
This part works ok, but I want the batch file to also copy the *found* files into C:\ByDate\%DATEINPUT%\
Any help is appreciated!
I want to be able to do a search within a directory and then copy the results into both
1) A text file
2) Copy the found files into a new directory
So far this is what I have:
Code: Select all
@ECHO OFF
SET /p SEARCHTERM=Enter the Search Term:
SET /p DATEINPUT=Enter the Date (Ex: 2010-05-27)
cd "C:\TotalListOfTerms"
FINDSTR /m /i "%SEARCHTERM%" *.* > "C:\ByDate\%DATEINPUT%\%SEARCHTERM%.txt"
------------------
This part works ok, but I want the batch file to also copy the *found* files into C:\ByDate\%DATEINPUT%\
Any help is appreciated!