windows命令行 批量对源代码添加版权头/头信息

时间:2023-11-10 11:18:44

简短精悍的代码,特别适合开源项目使用。

for /r %%F in (*.as) DO (
move "%%F" tmp.txt
type copyright.txt > "%%F"
type tmp.txt >> "%%F"
del tmp.txt
)
把上述代码保存为bat,另外同一级目录放置copyright.txt
修改(*.as)为相应的文件后缀,就可以对相应的代码文件加版权头