You want to run R in batch mode. It is pretty simple; There are some instructions here .
EDIT: I do not see the console window; Here are the steps I took.
1) I created a file with a name r.batcontaining a string Rterm --vanillaand saved it in the working directory of the R launch (as indicated Sys.getenv("USERPROFILE")).
2) R script, test.r, ( .
n <- 1e3
for(i in 1:10)
{
qr.solve(matrix(runif(n*n), nrow = n), seq_len(n)/(n+1))
}
, script, .
3) dos , r.bat, R <test.r> test.txt.