title: Read registry value that contains spaces using batch file
body: <p>I have a batch file that reads the registry value. </p>
  
  <p>However the entry that I am reading contains spaces and I only seem to capture everything before the first space character when setting my variable.</p>
  
  <pre><code>set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Entry"
  set VALUE_NAME=Home
  
  FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^&gt;nul`) DO (
      set ValueName=%%A
      set ValueType=%%B
      set Home=%%C
  )
  
  if defined ValueName (
      @echo Home = %Home%
  ) else (
      @echo %KEY_NAME%\%VALUE_NAME% not found.
  )
  </code></pre>
  
  <p>The home registry entry actually contains this string: "C:\Program Files (x86)\Dir1\Dir2" and the batch file only captures this: C:\Program</p>
  
  <p>Does anybody have an idea of how to fix this?</p>
  
  <p>Thanks</p>