中国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-12 10:05
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Here is a batch script example to generate all 6-digit numbers from 000000 to 999999. Note that this will produce a large number of lines and might take some time to execute depending on your system. ```batch @echo off setlocal enabledelayedexpansion for /l %%a in (0,1,9) do ( for /l %%b in (0,1,9) do ( for /l %%c in (0,1,9) do ( for /l %%d in (0,1,9) do ( for /l %%e in (0,1,9) do ( for /l %%f in (0,1,9) do ( echo %%a%%b%%c%%d%%e%%f ) ) ) ) ) ) endlocal ```
Printable Version  1,795 / 3
Floor1 trickster Posted 2010-12-12 17:22
初级用户 Posts 33 Credits 63
Ask everyone how to use batch processing to generate all numbers between 000000~999999 and save them to a TXT file
Thanks
Floor2 Hanyeguxing Posted 2010-12-12 17:32
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
```@echo off&setlocal enabledelayedexpansion
(for /l %%a in (1,1,999999) do (
set a=000000%%a
echo !a:~-6!
))>>1.txt
```
Floor3 acaigg Posted 2010-12-25 12:03
初级用户 Posts 92 Credits 115
Floor4 mountvol Posted 2010-12-25 12:09
初级用户 Posts 117 Credits 186
for /l %%i in (100000,1,999999) do echo %%i>>a.txt
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023