title: Windows batch string manipulation in loop
body: <p>I'm trying to make the directories "01", "02", "03", ..., "11" and "12" in the current directory. But for an unknown reason my padding 'function' of "0" doesn't work within a for loop. </p>
  
  <pre><code>@Echo on
  SET suffix=12
  SET v=0%suffix%
  SET v=%v:~-2%
  echo %v%
  pause
  
  (SET suffix=12
  SET v=0%suffix%
  SET v=%v:~-2%
  echo %v%)
  
  pause
  
    FOR /L %%q IN (9,1,11) DO (
  SET suffixb=%%q
  SET w=0%suffixb%
  SET w=%w:~-2%
  echo %w%
    )
  pause
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/a14WZ.png" alt="enter image description here"></p>