title: Getting substring of a token in for loop?
body: <p>I have this <code>for</code> loop to get a list of directory names:</p>
  
  <pre><code>for /d %%g in (%windir%\Assembly\gac_msil\*policy*A.D*) do (
  echo %%g
  )
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>C:\WINDOWS\Assembly\gac_msil\policy.5.0.A.D
  C:\WINDOWS\Assembly\gac_msil\policy.5.0.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.5.20.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.5.25.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.5.35.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.5.55.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.5.60.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.5.70.A.D.O
  C:\WINDOWS\Assembly\gac_msil\policy.6.0.A.D.O
  </code></pre>
  
  <p>I want to get the folder names starting with "policy" but <code>echo %%g:~29</code> doesn't work.
  I also tried to <code>set x=%%g</code> and then <code>echo %x:~29%</code> and still doesn't work.</p>
  
  <p>So, how do I get substring from token in <code>for</code> loop?</p>