Counting, the ugly way

@echo off
set X=0
echo set /a X+=1 >>%0
echo echo %%X%%>>%0

... But it does work ... each time you run it, the list of numbers grows by one :-)

The interesting part here is that the lines added during running are executed in the same instance of the running batch.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.