批处理基础(五)批量创建文件

file_exist.bat文件内容如下:
注:for /l %%i in (0, 1, 99) do语句中,/l指loop,表示循环,为带有步长的区间使用;
格式:for /l %variable in (start, step, end) do command [command-parameters]
start指起始值,step指步长,end指终止值;本例中,起始值为0,步长为1,终止值为99。

@echo off
echo 正在创建test0.txt~test99.txt共一百个文本文件......
for /l %%i in (0, 1, 99) do (
echo 我是test%%i.txt文件 >> test%%i.txt
)
echo 文件创建完毕

在这里插入图片描述在这里插入图片描述
在这里插入图片描述

发布了228 篇原创文章 · 获赞 44 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/qq_40945965/article/details/86708972
今日推荐