不要重复发帖
http://www.cn-dos.net/forum/viewthread.php?tid=42191&fpage=1###
@echo off
set mypath=E:
if not exist "%mypath%\合并" (
md "%mypath%\合并"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\合并" (
for /f "tokens=*" %%b in ('dir /s /b /a-d "%%a" 2^>nul') do (
if exist "%mypath%\合并\%%~nxb" (
ren "%mypath%\合并\%%~nxb" "%%~nb.old">nul 2>nul
)
move "%%b" "%mypath%\合并">nul 2>nul
)
)
)