For example, to generate sequences like 1, 2, 3... 999, how to do it?
Requirements: Do not use commands under XP.
Requirements: Do not use commands under XP.
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!
b 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
@echo off
for %%a in (1,2,3,4,5,6,7,8,9) do call c node%%a.htm
:redo
if "%1" == "" goto end
for %%a in (0,1,2,3,4,5,6,7,8,9) do call c node%1%%a.htm
if errorlevel 2 goto end
shift
goto redo
:end
@echo off
if not exist %1 echo %1 >> urls.lst
echo on

for /l %i in (1,1,389) do @if not exist file%i.html echo.file%i.html>>urls.lst
:: Count.bat - Generate a serial of numbers
:: Will Sort - 2005-11-26 - WinXP_CMD/MSDOS7.10/MSDOS6.22
:: Description: An independently runnable example program that outputs a sequence of numbers from 1 to 123 to a file
:: It can be simply modified to generate sequence numbers of any number of digits, any interval, and any format
:: Even decimals are possible to generate.
:: Link: http://www.cn-dos.net/forum/viewthread.php?tid=17883
@echo off
if "%1"==":" goto %2
set _prog=%0
call %_prog% : loop1 0 1 2 3 4 5 6 7 8 9
set _prog=
set _start=
set _break=
goto end
:loop1
if "%3"=="" goto end
if "%3"=="0" call %_prog% : loop2 0 1 2 3 4 5 6 7 8 9
:: If prefix 0 is needed for the generated sequence numbers, omit the above line and also delete the next line's if not "%3"=="0"
if not "%3"=="0" call %_prog% : loop2 %30 %31 %32 %33 %34 %35 %36 %37 %38 %39
if "%_break%"=="true" goto end
shift
goto loop1
:loop2
if "%3"=="" goto end
if "%3"=="0" call %_prog% : loop3 0 1 2 3 4 5 6 7 8 9
:: If prefix 0 is needed for the generated sequence numbers, omit the above line and also delete the next line's if not "%3"=="0"
if not "%3"=="0" call %_prog% : loop3 %30 %31 %32 %33 %34 %35 %36 %37 %38 %39
if "%_break%"=="true" goto end
shift
goto loop2
:loop3
if "%3"=="" goto end
if "%3"=="1" set _start=true
if "%_start%"=="true" echo.%3>>sn.txt
:: The above line is the functional code for counting. The example only outputs numbers to a file
if "%3"=="123" set _break=true
if "%3"=="123" goto end
:: _start is the mark to start counting, 1 is the boundary to start counting
:: _break is the mark to interrupt counting, 123 is the boundary to interrupt counting
shift
goto loop3
:end