无我居士 当前离线
列兵
aloha20200628 当前离线
少校
@echo off set "currentPath=%~dp0" set "targetFolder=C:\your\target\folder\path" cd /d "..\" robocopy "%currentPath:~,-1%" "%targetFolder%" /s /move /xF "%~f0" pause&exit/b复制代码
TOP
77七 当前离线
中校
@echo off rem 保存为ansi编码 cd /d "%~dp0" rem 指定目标文件夹路径 set "targetFolder=C:\your\target\folder\path" rem 遍历当前路径下的文件夹 for /d %%d in (*) do ( robocopy "%%d" "%targetFolder%\%%d" /e /move ) echo 移动完成。 pause复制代码
@echo off set "currentPath=%~dp0" set "targetFolder=C:\your\target\folder\path" for /d %%d in ("%currentPath%*") do move "%%d" "%targetFolder%\%%~nxd" pause&exit/b复制代码