本文最后更新于天前,内容可能已不再适用!

将所有子文件夹里的文件上移一层

覆盖同名文件

@echo off
(for /f "delims=" %%a in ('dir /b /s /ad') do (
        move /y "%%a\*.*" "%%a\.."&&rd %%a
))>nul 2>nul
for /f "delims=" %%i in ('dir /ad /b /s^|sort /r') do rd /q "%%i" 2>nul
pause

选择是否覆盖同名文件

@echo off
(for /f "delims=" %%a in ('dir /b /s /ad') do (
        move /-y "%%a\*.*" "%%a\.."&&rd %%a
))>nul 2>nul
for /f "delims=" %%i in ('dir /ad /b /s^|sort /r') do rd /q "%%i" 2>nul
pause

将当前文件夹里子文件夹里的文件移动到all文件夹

for /f "delims=" %%p in ('dir /b/ad') do move %%p\*.* all\
pause
最后修改:2020-10-28 21:00:58
如果觉得我的文章对你有用,请随意赞赏