title: Batch File issue, recieving "The Filename, Directory Name, Or Volume Label Syntax Is Incorrect"
body: <p>I'm recieving the following error when I run my batch file
  "The Filename, Directory Name, Or Volume Label Syntax Is Incorrect"</p>
  
  <p>My batch file runs fine, but this error pops up 25 times and then proceeds.  I can't figure out what i'm missing here.  Below is my code:</p>
  
  <pre><code>::This batch file is used to set a static IP and launch Windows Recovery Environment
  
  @setlocal enableextensions enabledelayedexpansion
  @echo off
  
  ::Setting Static IP Address &amp; DNS Address
  
  netsh interface ipv4 set address "Local Area Connection" static 10.11.111.110 255.255.255.0 10.11.111.249 1
  
  netsh interface ipv4 set dns "Local Area Connection" static 10.11.101.1 primary
  
  ::Verify Network Connection
  
  :chklink
  
  set ipaddr=10.11.107.20
  
  set oldstate=neither
  
  set state=down
  
  for /f "tokens=5,7" %%a in ('ping -n 1 !ipaddr!') do (
  
      if "x%%a"=="xReceived" if "x%%b"=="x1," set state=up
  )
  
  if not !state!==!oldstate! (
  
      echo.Link is !state!
  
      set oldstate=!state!
  
  )
  
  REM ping -n 2 127.0.0.1 &gt;nul: 2&gt;nul:
  
  
  SET answer=!state!
  
  IF %answer%==up (
  
  goto recovery
  
  
  ) ELSE (
  
  IF %answer%==down (
  ::Set static address on NIC 2 if NIC 1 failed
  
  netsh interface ipv4 set address "Local Area Connection 2" static 10.11.111.110 255.255.255.0 10.11.111.249 1
  
  netsh interface ipv4 set dns "Local Area Connection 2" static 10.11.101.1 primary
  
  goto chklink
  
  
  )
  )
  
  ::Launch Windows Recovery Environment
  
  :recovery
  
  cls
  
  x:\sources\recovery\recenv.exe
  
  exit
  </code></pre>
  
  <p>===========================================================</p>
  
  <p>Any help would be great!</p>
  
  <p>Thanks!</p>
  
  <p>Derek</p>