Zend certified PHP/Magento developer

Batch Script to Copy Different files with different names form one location to another location

Following is my requirement:

I need to extract 500 .txt files from 27000 .txt files and each file has a different file name and all files are placed in different subfolders.

Now I need to copy those specific files to another location.

I have a list of 500 filenames.

E.g.:


Parent folder: Root
Subfolder1: Has 12000 files
Subfolder2: Has 15000 files

Filenames:
882.txt
550.txt
990.txt
300.txt etc. total 500 different names.

Now from above 27000 files I need to extract specific filenames and copy to another location.

Following is the code which can copy one file at a time from 27000 files. Therefore, if someone can help me in amending the code that can ‘cater 500 filenames’ in single code.

@ECHO ON
SET RootDir=E:Source
SET CopyDir=E:Destination
IF NOT EXIST "%CopyDir%" MD "%CopyDir%"

SET CopyFname=882.txt '(Need to cater more file names rather than one such as 882.txt, 992.txt, 555.txt etc)'

FOR /D %%A IN ("%RootDir%*") DO FOR %%B IN ("%%~A%CopyFname%") DO ECHO F | XCOPY /Y /F "%%~B" "%CopyDir%"
GOTO EOF