title: unable to execute a batch file from the task scheduler
body: <p>I am struggling with this since yesterday, i have created a Batch file -a simple one- which simply will try to read the logs of a windows scheduled task and based on searching for correct 'Last result' will log 0 or 1 to a log file . The Batch file run perfectly .
  But i want to schedule this Batch file to be ran each 2 minutes ,</p>
  
  <p>so i create a scheduled task that ran this batch file ;When i force starting the scheduled task, I don't see any errors in the task scheduler history, but at the same time my Batch file is not executed.</p>
  
  <p>What i tried, 
  -i made sure i am running the scheduled task with option "run with highest privileges" , 
  -i made sure i have correct permissions (still not sure)
  I tried using process monitor and didn't see any access issues 
  so nothing happens when i run my task i am going crazy,</p>
  
  <p>This is the content of my Batch file :</p>
  
  <p><pre>     SET LOGFILE=MyLogFile.log
      call :Logit >> %LOGFILE% 
      exit /b 0</p>
  
  <code>:Logit
  :: The rest of your code
  :: ....
  for %%A in (DownloadToIngest.log) do set fileSize=%%~zA
  echo %fileSize%&gt;logall.log
  if %fileSize% GTR 419430400 (break&gt;DownloadToIngest.log)
  
  schtasks /QUERY /FO LIST /V /tn DownloadToIngest&gt; DownloadToIngestOutput.log
  findstr /m "Last Result:                          0" DownloadToIngestOutput.log
  IF %errorlevel%==0 (&gt;&gt;DownloadToIngest.log  echo 1) ELSE &gt;&gt;DownloadToIngest.log  echo 0&lt;code&gt;
  </code></pre>