将所有子文件夹里的文件上移一层
覆盖同名文件
@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