<p><code>for /l</code> is your friend:</p>
<pre><code class="lang-auto">for /l %x in (1, 1, 100) do echo %x
</code></pre>
<p>Starts at 1, increments by one, and finishes at 100.</p>
<p><strong>WARNING:</strong> Use <code>%%</code> instead of <code>%</code>, if it’s in a fichier batch, like:</p>
<pre><code class="lang-auto">for /l %%x in (1, 1, 100) do echo %%x
</code></pre>
<p>(which is one of the things I really really hate about windows scripting.)</p>
<p>If you have multiple commands for each iteration of the loop, do this:</p>
<pre><code class="lang-auto">for /l %x in (1, 1, 100) do (
echo %x
copy %x.txt z:\whatever\etc
)
</code></pre>
<p>or in a fichier batch:</p>
<pre><code class="lang-auto">for /l %%x in (1, 1, 100) do (
echo %%x
copy %%x.txt z:\whatever\etc
)
</code></pre>
<p>Key:</p>
<ul>
<li>
<p><code>/l</code> denotes that the <code>for</code> command will operate in a numerical fashion, rather than operating on a set of files</p>
</li>
<li>
<p><code>%x</code> is the loops variable and will be <code>(starting value, increment of value, end condition[inclusive] )</code></p>
</li>
</ul>