With my limited knowledge, I cobbled together the following batch file:
Code: Select all
@echo off
cd c:\X
for /d /r %%f in (*) do (
if exist %%f\*.jpg (
ROBOCOPY %%f C:\Y *.jpg *.tif /S
)
)
Whilst this successfully identifies folders containing .jpg files and copies both .jpg and .tif files to the destination C:\X, the /S option of robocopy doesn't work in this case and only the files are copied, not the containing folder. I am not sure what is causing this to happen. Any help is greatly appreciated.