title: How to make FOR /F tokens work more universal (path related)
body: <p>I have a situation here that is as followed:</p>
  
  <p>I've extracted a registry value under <code>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders</code> with folder locations.</p>
  
  <p>The problem is that the code works for a path that has a space in it, but if i use the very same code for a path that has no spaces in it, the output is wrong.</p>
  
  <p>I know it is related to <code>tokens</code> but i'm hoping there is a way to make the code work for both cases .</p>
  
  <p>The code i currently have looks as followed:</p>
  
  <pre><code>FOR /F "tokens=2*" %I in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Startup ') DO echo "%J"
  </code></pre>
  
  <p>and the output:</p>
  
  <pre><code>"%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
  </code></pre>
  
  <p><strong>On a side note</strong>: expanding <code>%USERPROFILE%</code> is no problem for me, i simply use the <code>CALL</code> function for that</p>
  
  <p>Now, when changing the path of registry value <code>Startup</code> to something that doesn't have any spaces in it, the before mentioned code fails.</p>
  
  <p>Hopefully someone has a way to make it work in both cases.</p>
  
  <p>With best regards,</p>
  
  <p><strong>copyitright</strong></p>