@echo off
set a="%cd%"
cd\
for /f "delims=" %%i in ('dir /s /ad /b folder1') do (
echo D | xcopy /e /c /h /y %a%\A\*.* "%%i\A")
for /f "delims=" %%i in ('dir /s /ad /b folder2') do (
echo D | xcopy /e /c /h /y %a%\B\*.* "%%i\B"
echo D | xcopy /e /c /h /y %a%\B\*.* "%%i\B")
cd %a%
文件夹1名称替换folder1;文件夹2名替换folder2;然后将代码写入1.bat放在当前目录下,执行之