@echo off setlocal rem 检查是否提供了目标路径参数 if "%~1"=="" ( echo Usage: %0 targetPath exit /b 1 ) rem 设置目标路径 set "targetPath=%~1" rem 查找并复制 DLL 文件 for /r ..\packages\ %%D in (.) do ( if exist "%%D\net461\*.dll" ( echo Copying DLLs from %%D\net461 to %targetPath% xcopy "%%D\net461\*.dll" "%targetPath%" /Y /I ) ) echo Done. endlocal