I need extension to this question: search given set of files and copy to another directory
There is a given set of file names in a needToFind.txt file such as:
m
@echo off
cd "\MyImageFolder"
for /f "usebackq eol=: delims=" %%F in ("needToFind.txt") do copy "%%~F.*" "\anotherFolder"
If the provided file names already have extensions, and you want to ignore the extensions, you can use
@echo off
cd "\MyImageFolder"
for /f "usebackq eol=: delims=" %%F in ("needToFind.txt") do copy "%%~nF.*" "\anotherFolder"
@echo off
cd "\MyImageFolder"
for /F "usebackq delims=" %%a in ("needToFind.txt") do (
for /R %%b in ("%%~Na.*") do copy "%%b" "\anotherFolder"
)