@echo offset "fd1=d:\aaa"set "fd2=e:\bbb"set "fd3=e:\ccc"for /f "delims=" %%a in ('dir /a-d/b "%fd1%"') do ( if exist "%fd2%\%%~nxa" copy "%fd2%\%%~nxa" "%fd3%\" copy "%%a" "%fd2%\" /y)pause