title: batch script if statement - unexpected (
body: <p>I have written a script on Windows 7 which keeps giving me an error of "( was unexpected at this time." for the following code</p>
  
  <pre><code>if %vardns%=="NODNS" (
    netsh interface ipv4 set address name="%__ethAdapter.42%" source=static addr=%varip_old% mask=%varsubnet_old% gateway=%vargateway_old% gwmetric=1
  ) else (
    netsh interface ipv4 set address name="%__ethAdapter.42%" source=dhcp
  )
  </code></pre>
  
  <p>I am not sure where the issue lies and have read many other posts. Any help would be kindly appreciated. Thanks in advance.</p>