@echo off
set "str=Hello"
set "count=100"
set "output_file=output.txt"
:: 清空输出文件
type nul > "%output_file%"
:: 使用for循环写入字符串
for /L %%i in (1,1,%count%) do set /p="%str%" <nul >> "%output_file%"
:: 结束
exit /b
Bat/Cmd不换行追加到文件
于 2024-06-28 10:24:13 首次发布