- @echo off
- mode con lines=3000
- set "folder1=D:\xxx\A"
- set "folder2=D:\yyy\B"
- if not exist "%folder1%" (echo;"%folder1%" not found&pause&exit)
- if not exist "%folder2%" (echo;"%folder2%" not found&pause&exit)
- set ext=jpg jpeg bmp png gif tif
- for /f "delims=" %%a in ('dir /a-d-h/b/s "%folder2%\*.pdf"') do (
- set "f="
- for %%b in (%ext%) do (
- if exist "%folder1%\%%~na.%%b" set f=1
- )
- if defined f (
- echo;"%%a" --^> "%folder1%\"
- copy /y "%%a" "%folder1%\"
- )
- )
- pause
- exit
复制代码
|