R System command working in R studio, but its not working in Rescript batch mode, is there any method to invoke vbs script from Rescript mode?

127 views Asked by At

I have below code in new.R file, which is working fine in RStudio interactive mode.

system_command <- paste("WScript", " C:/Users/OneDrive/Desktop/r1.vbs")
system(command = system_command)

But when I run the new.R file using Rscript, its not invoking the vbs script. Is there any other way to invoke vbs script in Rscript mode?

1

There are 1 answers

0
esin tulun On

I had a similar problem with system2() wenn i wanted to start a new Rscript-process in the background. R version 4.3.0 Windows 10 Programm works in RStudio, but not in Powershell: in Powershell no background process is started. I added short slepp time in programm. This help.