title: Windows batch programming - Unexpected at this time
body: <p>I am just trying out some basic batch programming. I am getting some error during execution</p>
  
  <pre><code>set /a x=0
  :while1
  if %x% leq 5 (
      echo %x%
      goto:callfun
      /dir:/Prod /user:admin /pass:anc /level:error &gt;&gt; C:\Logs\A.txt
     set file=C:\Logs\J_FINANCIALS_EVENING.log
     set /a "cnt=0"
     for /f %%a in ('type "%file%"^|find "!Kitchen.Error.NoRepDefinied!" /i /c') do set /a cnt=%%a
       if %cnt% NEQ 0 (
            if %x% NEQ 5 (
                DEL C:\Logs\abc.txt
                )
        set /a x=x+1
        goto :while1
  
  )
      echo "OUTSIDE LOOP"
     echo The Status is %errorlevel%
    call:check_file
    exit /b %errorlevel%
  
  )
    endlocal
  
  callfun: 
  CALL C:\Pentaho\pdi-ce-5.2.0.0-209\data-integration\kitchen.bat /rep:"Admin" /job:"XXXX" 
  </code></pre>
  
  <p>I am getting the error at </p>
  
  <p>set /a "x = 0"</p>
  
  <p>0 was unexpected at this time. </p>
  
  <p>What am I doing wrong here?</p>