title: Append output of R CMD BATCH
body: <p>i have a for loop in a batch  file which runs the same r script with different parameters and i want all output to be appended to the same file.</p>
  
  <p>here is an example:</p>
  
  <p><strong>Batch Code</strong></p>
  
  <pre><code>for %%i in ([folder name]) do (
    R CMD BATCH --slave "--args %%i" Script.R output.out
  )
  </code></pre>
  
  <p><strong>Script.R Code</strong></p>
  
  <pre><code>cmdArgs = commandArgs(trailingOnly = TRUE)
  cat("Args: ", cmdArgs[1], "\n")
  cat("End")
  </code></pre>
  
  <p>I have tried using 2>&amp;1 and it's not working.</p>
  
  <p>I am using a windows machine and prefer not to redirect output from within the R script and can't user RScript, any ideas?</p>