Hi - haven't had any luck finding this type of script:

1. I have a pre-defined list of filenames (stored in a plain txt document
called 'files.txt')
2. I'd like to write a script that will search the file system For each
file in the plain txt document (could be nested in sub-directories) and copy
them to a new location

I've found plenty of examples for finding types of files (i.e. .mp3's,
.zip's, etc.) but nothing that will let me pass in specific (& unique)
filenames.

Thanks for your help!

Re: Way to recursively Find pre-defined files (from list) and Copy by Matthias

Matthias
Sat Nov 27 12:52:42 CST 2004

Ken Osborn schrieb:
> Hi - haven't had any luck finding this type of script:
>
> 1. I have a pre-defined list of filenames (stored in a plain txt document
> called 'files.txt')
> 2. I'd like to write a script that will search the file system For each
> file in the plain txt document (could be nested in sub-directories) and copy
> them to a new location
>
> I've found plenty of examples for finding types of files (i.e. .mp3's,
> ..zip's, etc.) but nothing that will let me pass in specific (& unique)
> filenames.
>
> Thanks for your help!
>
In an os of the nt line this should do:

for /f "delims=" %A in ('dir /B/S/AD^|findstr /G:files.txt') do @echo copy "%~fA" newlocation

This will only echo what it would copy without echo.

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+