@echo off REM 首先遍历最外层的文件夹, for /f %%i in ('"dir /ad/b/on *.*"') do ( echo"First Dir: %%~fi" REM MKDIR OF DESTINATION md E:\Destination\%%i cd %%~fi REM 获取到子文件夹之后再递归遍历子文件夹 for /f %%j in ('"dir /ad/b/on *.*"') do ( echo"Second Dir:%%~fj" REM MKDIR OF DESTINATION md E:\Destination\%%i\%%j cd %%~fj REM 拷贝每个文件到预定的路径中 for %%k in (*.las) do ( echo"Third Dir:%%~fk" REM COPY EACH LAS FILE xcopy %%k E:\Destination\%%i\%%j\ /E /D /R /Y ) REM 返回到上层文件夹,继续后续的遍历 cd .. ) REM 同理 cd .. ) REM 脚本运行完之后不退出 pause