title: Batch file IF statement fails with "was unexpected at this time"
body: <p>I have a batch file that does the following:</p>
  
  <pre><code>@IF EXIST "C:\Program Files\MyAppFolder" (
    icacls "C:\Program Files\MyAppFolder" /inheritance:r
    icacls "C:\Program Files\MyAppFolder" /GRANT SYSTEM:(CI)(OI)(F)
    icacls "C:\Program Files\MyAppFolder" /GRANT Administrators:(CI)(OI)(F)
  )
  </code></pre>
  
  <p>Individually the commands work fine but put together like this in an <code>IF</code> statement I get this error and the script stops in its tracks:</p>
  
  <pre>(OI)(F) was unexpected at this time.</pre>
  
  <p>If I just have a single command in the <code>IF</code> statement then it works fine.</p>
  
  <p>I'm guessing that you're only permitted one statement between the <code>IF</code> parenthesis?</p>
  
  <p>This happens on Windows 2008 and Windows 2003 (<a href="http://support.microsoft.com/kb/943043/" rel="noreferrer">with the ICACLS hotfix</a>).</p>