title: Batch - B) is unexpected at this time
body: <p>Trying to edit a registry querying batch file to set the path from the registry's entry.
  I'm being returned with this error when attempting to run the batch file.</p>
  
  <p>If I input a snippet manually in to command prompt it will read and set the path perfectly.</p>
  
  <blockquote>
    <p>B) was unexpected at this time</p>
    
    <p>@For /F "Tokens=2* skip=2" B)</p>
  </blockquote>
  
  <pre><code>SETLOCAL ENABLEEXTENSIONS
  
  :v64bita2
  @For /F "Tokens=2* skip=2" %A In ('REG QUERY "HKLM\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2" /v "MAIN"') Do (set ARMA2PATH=%B)
  IF NOT DEFINED ARMA2PATH (GOTO v32bita2) ELSE (GOTO v64a2oa)
  
  :v32bita2
  @For /F "Tokens=2* skip=2" %C In ('REG QUERY "HKLM\SOFTWARE\Bohemia Interactive Studio\ArmA 2" /v "MAIN"') Do (set ARMA2PATH=%D)
  IF NOT DEFINED ARMA2PATH (GOTO uaca2) ELSE (GOTO v64a2oa)
  
  :uaca2
  @FOR /F "tokens=2* delims=   " %I IN ('REG QUERY "HKLM\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2" /v "MAIN"') DO (SET ARMA2PATH=%J)
  IF NOT DEFINED ARMA2PATH (GOTO stda2) ELSE (GOTO v64a2oa)
  
  :stda2
  @FOR /F "tokens=2* delims=   " %K IN ('REG QUERY "HKLM\SOFTWARE\Bohemia Interactive Studio\ArmA 2" /v "MAIN"') DO (SET ARMA2PATH=%L)
  IF NOT DEFINED ARMA2PATH (GOTO ENDfailA2) ELSE (GOTO v64a2oa)
  
  :v64a2oa
  For /F "Tokens=2* skip=2" %E In ('REG QUERY "HKLM\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2 OA" /v "MAIN"') Do (set ARMA2OAPATH=%F)
  IF NOT DEFINED ARMA2OAPATH (GOTO v32a2oa) ELSE (GOTO RUN)
  
  :v32a2oa
  For /F "Tokens=2* skip=2" %G In ('REG QUERY "HKLM\SOFTWARE\Bohemia Interactive Studio\ArmA 2 OA" /v "MAIN"') Do set (ARMA2OAPATH=%H)
  IF NOT DEFINED ARMA2OAPATH (GOTO uaca2oa) ELSE (GOTO RUN)
  
  :uaca2oa
  @FOR /F "tokens=2* delims=   " %M IN ('REG QUERY "HKLM\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2 OA" /v "MAIN"') DO (SET ARMA2OAPATH=%N)
  IF NOT DEFINED ARMA2OAPATH (GOTO stda2oa) ELSE (GOTO RUN)
  
  :stda2oa
  @FOR /F "tokens=2* delims=   " %O IN ('REG QUERY "HKLM\SOFTWARE\Bohemia Interactive Studio\ArmA 2 OA" /v "MAIN"') DO (SET ARMA2OAPATH=%P)
  IF NOT DEFINED ARMA2OAPATH (GOTO ENDfailA2OA) ELSE (GOTO RUN)
  
  ENDLOCAL
  
  :run
  
  title CMG - Mod Downloader
  
  echo .
  echo Downloading Mods Now
  echo .
  
  :ENDfailA2
  echo ArmA 2 Not Installed
  pause
  
  :ENDfailA2OA
  echo ArmA 2 OA Not Installed
  pause
  </code></pre>