title: The use of a variable in a variable
body: <p>I cannot use a variable '%a' inside of variable 'varname' in this code:</p>
  
  <pre><code>@echo of
  set varname=stringhere
  for /l %%a in (1,1,10) do (
      echo %varname:~1,%%a%
      ping -n 0.01 &gt;nul
  )
  </code></pre>
  
  <p>But what it displays is:</p>
  
  <blockquote>
    <p>a% a% a% a% a% a% a% a% a% a%</p>
  </blockquote>
  
  <p>What I want it to display as:</p>
  
  <blockquote>
    <p>s st str stri strin string stringh stringhe stringher stringhere</p>
  </blockquote>
  
  <p>So in words I am trying to optimize my code as much as possible and I want to make a function that prints out a variable one letter at a time but it isn't letting me use substring in the way I want it to..</p>