I'm struggling with the different R executables. What exactly is the difference between R.exe (with or without CMD BATCH option), Rcmd.exe, Rscript.exe and Rterm.exe when running command line in a batch file?
And what is the difference between:
R.exe --no-environ --no-save < "c:\temp\R\test.R" > "c:\temp\R\out.txt" 2>&1
R.exe CMD BATCH --no-environ --no-save "c:\temp\R\test.R" "c:\temp\R\out.txt"
Caveat: I work much more on Linux then Windows but
Rcmd.exeis a historical left-over as back in the day, you could not do
R CMD somethingon Windows but needed the special executable
Rcmd.exe something. That is no longer the case, yet it is provided for backwards compatibility.
Rterm.exeis also a holdover from the days when
Rcmd.exewas used. Can be ignored these days.
R CMD BATCHis a clutch that was needed in the days before littler and
Rscript.exe, and similarly lingering from old docs and habits..
Rscript.exeis your friend for batch scripts; use it.
Other than that, as Marek hinted, the reference manual is the wrong one among the six available manuals. Try the Introduction to R and the Installation and Admin manuals both of which have specific appendices for Windows.
Edit Added forgotten
Rterm.exe entry above.