中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-05 02:06
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » [Help] Batch create folders named 1 to 100
Printable Version  3,093 / 34
Floor1 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
Dear everyone:

I want to make a batch processing, the content is as follows:
First create a folder named 666, then create 100 subfolders under it, and the folder names are 1~~100 in turn. How to achieve it, please give advice, thank you!


───────────────── Moderation Record ─────────────────
Performed by: Will Sort
Operation: Modify Title - ********Urgent!!!
───────────────── Moderation Record ─────────────────


[ Last edited by willsort on 2006-6-20 at 21:41 ]
Floor2 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
md 666
cd 666
for /l %%a in (1,1,100) do md %%a
Floor3 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
It doesn't work. It shows a parameter error! Still, thanks for the help!
Floor4 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
Are you using pure DOS?
Floor5 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
Or is it DOS under Windows 98?
Floor6 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
Is it DOS under 98?
Floor7 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
No translation needed as the content is already in English. So the output remains the same:

怪不得下次需要把操作系统说清楚是98的话echo md %%1>md.bat
echo md 2%%1>>md.bat
echo md 3%%1>>md.bat
echo md 4%%1>>md.bat
echo md 5%%1>>md.bat
echo md 6%%1>>md.bat
echo md 7%%1>>md.bat
echo md 8%%1>>md.bat
echo md 9%%1>>md.bat
echo md 100>>md.batfor %%a in (1 2 3 4 5 6 7 8 9) do call md.bat %%a由于本人没98系统一下也不能重启进入DOS不知道能行吗?希望楼主先试下
还有就是在上面部分不知道能用
echo md %%1
echo for %%%a in (2 3 4 5 6 7 8 9) do md %%a%%1
Floor8 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
Still not working, can only create folders named 1, 2, 3, 4, 5, 6, 7, 8, 9, and 100, and the 666 folder is gone!
Floor9 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
echo md %%1>md.bat
echo md 2%%1>>md.bat
echo md 3%%1>>md.bat
echo md 4%%1>>md.bat
echo md 5%%1>>md.bat
echo md 6%%1>>md.bat
echo md 7%%1>>md.bat
echo md 8%%1>>md.bat
echo md 9%%1>>md.bat
echo md 100>>md.batfor %%a in (1 2 3 4 5 6 7 8 9) do call md.bat %%aIs that not right? The above code doesn't work? But,楼主,I really admire you. Can't you just add MD 666 CD 666 by yourself?
Floor10 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
Wait a minute I'll go check for you
Floor11 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
It seems there are some issues with the parameters! Sorry, I'm a newbie! Thanks for the support!
Floor12 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
It really not work. I really don't know why using FOR can't work alone! Otherwise you can only use this command more trouble. I haven't thought of a good way yet. Use this first.

md 666
cd 666
for %%a in (1 2 3 4 5 6...100) do md %%a
Among them, (1 2 3 4 5 6...100) are numbers from 1 to 100
Floor13 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
Thanks, if there are 100 .txt files inside, how to operate!
Floor14 chenhui530 Posted 2005-03-10 00:00
高级用户 Posts 273 Credits 772
md 666
cd 666
for %%a in (1 2 3 4 5 6...100) do echo %%a>%%a.txt
Floor15 7451 Posted 2005-03-10 00:00
初级用户 Posts 16 Credits 140
No, only a file named %a.txt appears!
1 2 3  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023