I'm new in batch and have made a program that writes a file with the %num%
variable.
I'm having problems with the sum. Instead of returning 1
, 2
and 3
, it returns (0+1)
,((0+1)+1)
and (((0+1)+1)+1)...
Here is the code:
set num=0 :loop set num=(%num%+1) echo test > "%num%".txt pause goto loop;