「批处理」合并文件
直接上代码
后续还是powershell吧...
@echo off setlocal enabledelayedexpansion set fileListFileName=1.txt set fileNameTemp=TotalTemp.html set fileName=Total.html del %fileName% del %fileListFileName% del %fileNameTemp% for /R %%a in (*.html) do (echo %%a>>%fileListFileName%) set /p first=<%fileListFileName% echo %first% copy %first% %fileNameTemp% for /f "skip=1" %%i in (%fileListFileName%) do ( set var=%%i copy !fileNameTemp!+!var! !fileNameTemp! ) sort %fileNameTemp% > %fileName% del %fileNameTemp% del %fileListFileName%
每多学一点知识,就少写一行代码