title: Calculating within a FOR loop
body: <p>I'm trying to set up scheduled tasks for all the machines in our network. So they don't all have the same start time I edit the XML file to use a random time. The changing the XML works fine, but as soon as I put a For loop around it to use servers.txt I get an error message: "+10 was unexpected at this time."</p>
  
  <pre><code>@echo off
  
  for /F "tokens=*" %%i in (servers.txt) do (
  
  set file=original.xml
  set insertline=9
  SET /a uur=(%RANDOM%*6/32768)+10
  SET /a minuut=(%RANDOM%*50/32768)+10
  set output=output.XLM
  
  (for /f "tokens=1* delims=[]" %%a in ('find /n /v "##" ^&lt; "%file%"') do (
      if "%%~a"=="%insertline%" (
      echo ^&lt;StartBoundary^&gt;2018-12-17T%uur%:%minuut%:43.9766025^&lt;^/StartBoundary^&gt;
      REM ECHO.%%b
      ) ELSE (
      echo.%%b
      )
      )) &gt; %output%
  
  SchTasks /Create /S \\%%i /RU username /RP password /XML output.XLM /TN task_name
  
  )
  </code></pre>