title: Add counter value in Windows cmd script
body: <p>My script goes similar to this:</p>
  
  <pre><code>cd &lt;Directory&gt;
  set counter = 1
  for /r %%f in (*) do (
  &lt;Do task&gt;
  echo Task completed for file&lt;counter&gt; &gt;&gt; C:\log
  counter++
  )
  </code></pre>
  
  <p>I can't figure out how to use the actual <code>counter</code> value. If i use <code>counter</code> or <code>%counter%</code> it simply echoes the same string. How should i modify the <code>counter</code> lines in this case?</p>