@echo off & setlocal EnableDelayedExpansion
cd /d c:\txtfiles
for /f "delims=" %%a in ('dir /a:-d /b *.txt') do (
set /a n+=1
set FileList="%%a"+!FileList!
if !n!==200 call :merge
)
if defined n call :merge
pause & exit /b
:merge
set /a name+=1
copy !FileList:~,-1! 200-!name!.txt >nul
set "n=" & set "FileList="
cls & echo 已生成 !name! 个合并文件
Last edited by tireless on 2008-12-12 at 13:43 ]