Rscript very convenient ( R CMD BATCH is an old way) specially under the windows, but as a rule, under I create a batch file to avoid all the headaches.
For example, say launcher.bat:
@echo off C: PATH C:\Programme\R\R-3.0.1\bin;%path% cd PATH_TO_YOUR_RSCRIPT Rscript tryCatch.R 1 pause
And open the console (using cmd), go to where you saved your launcher.bat file and run it. Or from R-cosnol using shell :
shell('path_to_launcher\launcher.bat')
source share