I\'ve spent the past 3hrs trying to work this out but just couldn\'t find a solution. Here\'s my batch script:
if NOT Exist Counter.txt GOTO START
Type c:\\count
A little bit late for the party, but it's an interessting question.
You can write your own inc.bat for incrementing a number.
It can increment numbers from 0 to 9998.
@echo off
if "%1"==":inc" goto :increment
call %0 :inc %counter0%
set counter0=%_cnt%
if %_overflow%==0 goto :exit
call %0 :inc %counter1%
set counter1=%_cnt%
if %_overflow%==0 goto :exit
call %0 :inc %counter2%
set counter2=%_cnt%
if %_overflow%==0 goto :exit
call %0 :inc %counter3%
set counter3=%_cnt%
goto :exit
:increment
set _overflow=0
set _cnt=%2
if "%_cnt%"=="" set _cnt=0
if %_cnt%==9 goto :overflow
if %_cnt%==8 set _cnt=9
if %_cnt%==7 set _cnt=8
if %_cnt%==6 set _cnt=7
if %_cnt%==5 set _cnt=6
if %_cnt%==4 set _cnt=5
if %_cnt%==3 set _cnt=4
if %_cnt%==2 set _cnt=3
if %_cnt%==1 set _cnt=2
if %_cnt%==0 set _cnt=1
goto :exit
:overflow
set _cnt=0
set _overflow=1
goto :exit
:exit
set count=%counter3%%counter2%%counter1%%counter0%
A sample for using it is here
@echo off
set counter0=0
set counter1=
set counter2=
set counter3=
:loop
call inc.bat
echo %count%
if not %count%==250 goto :loop