Create a Batch File That Produces a Specific List

This I think should be very simple but I can't seem to figure it out. What I am trying to accomplish is to create a batch file that looks in a specific Parent folder and all files that equal *fanart.jpg should be copied into a separate folder and overwriting any file that already has that name.

You only need a single line to do that:

You only need a single line to do that:

Well the above line is good if I'm looking for a particular file (*fanart.jpg) within a particular folder within the parent folder. What I am looking for is all the *fanart.jpg that resides in the parent and to have those copied into a different location.

To find only in parent...
xcopy /y /h c:parent*fanart.jpg c:target

To find in parent and all subfolders...
xcopy /s /y /h c:parent*fanart.jpg c:target

That did it!

Actually take that back how do I get it extracted from the folders when being copied over?

Share this

Related Posts