China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-09-25 12:15
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Batch create folders named 1 to 100 View 3,475 Replies 34
Floor 31 Posted 2007-05-05 11:36 ·  中国 湖北 武汉 武昌区 电信
中级用户
★★
Credits 210
Posts 79
Joined 2007-04-14 10:49
19-year member
UID 85130
Gender Male
From 湖北
Status Offline
cd\
md a
cd a
for /l %%a in (1,1,100) do @md %%a
That's it
I tried it
Floor 32 Posted 2007-05-12 18:31 ·  中国 广东 汕头 潮阳区 电信
高级用户
★★★
DOS时空
Credits 713
Posts 348
Joined 2007-02-10 13:59
19-year member
UID 79169
Gender Male
Status Offline
In the for /l loop, "/l" stands for "loop". It is used to create a numeric sequence - controlled loop. The syntax "for /l %%a in (start, step, end)" is used to iterate from the start number, with the specified step, up to the end number. In the given code, "for /l %%a in (1,1,100) do md %%a" will create 100 directories named from 1 to 100.
Floor 33 Posted 2007-05-12 18:46 ·  中国 浙江 杭州 联通
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
Originally posted by haiou327 at 2007-5-12 06:31 PM:

What does /l mean here?


for /?
Floor 34 Posted 2007-06-21 17:29 ·  中国 福建 厦门 电信
初级用户
★
Credits 66
Posts 32
Joined 2007-01-15 12:56
19-year member
UID 76587
Gender Male
Status Offline
There is a simplest method. Open Excel, input "md 1" in it, drag until 100, copy, create a text file, paste it in, change the extension to bat, and then run it.
Floor 35 Posted 2007-06-22 00:09 ·  中国 四川 南充 电信
初级用户
★
Credits 43
Posts 14
Joined 2006-12-21 06:46
19-year member
UID 74122
Gender Male
Status Offline
The idea on floor 34 is very creative, reflecting the thought of mixed programming.
Forum Jump: