@echo off
setlocal enabledelayedexpansion
for /r %%a in (*.txt) do if "%%~xa"==".txt" set "file="%%~a"+!file!"
set NowTime=%time:~,8%
set NowTime=!NowTime::=!
set NowTime=!NowTime: =0!
copy /b !file:~,-1! "!NowTime!_NewFile.txt"
pause
脚本放在当前目录,即可把此目录中包含子目录里的txt文件全部合并。
新的文件命名格式为“时间_NewFile.txt”