@echo off::设置要添加的内容set str=这是首行内容for /f "delims=" %%a in ('dir /a-d/s/b *.txt') do ( (echo %str% type "%%~a")>tmp_file$ move /y tmp_file$ "%%~a">nul)pause
这个就是对当前目录下(包括子目录),所有txt文档添加指定内容。