Scrolling for a cycle% x% times per batch

Okay, so let's say I have a variable, and let's call it x. And I have this loop:

for %%i in (%x%) do ( REM --Code goes here-- ) 

Now this loop will be executed once, assuming x is equal to about 10. And if I wanted it to be 10 times, I could do this:

 for %%i in (1 2 3 4 5 6 7 8 9 10) do ( REM --Code goes here-- ) 

But say that x is equal to 105, how would I do it?

+7
source share
1 answer

See for /? documentation for the /L option.

 for /L %%A in (1,1,%x%) do ( REM --Code goes here-- ) 
+9
source

All Articles