I am trying to run the following batch command. The command has been extracted from the IDE so is confirmed working. Getting the error mentioned below.
I have tried
I encountered a similar problem using windows command line for R script, Rscript.exe, which is very sensitive to spaces in the path. The solution was to create a virtual path to the binary folder using the windows subst
command.
The following fails: "C:\Program Files\R\R-3.4.0\bin\Rscript.exe"
Doing following succeeds:
subst Z: "C:\Program Files\R\R-3.4.0"
Z:\bin\Rscript.exe
The reason the above-proposed solutions didn't work, evidently, has to do with the Rscript.exe executable's own internal path resolution from its working directory (which has a space in it) rather the windows command line being confused with the space. So using ~
or "
to resolve the issue at the command line is moot. The executable must be called within a path lacking spaces.
Go to Start and search for cmd
. Right click on it, properties then set the Target
path in quotes. This worked fine for me.