Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

issue when calling executable in a path that has space

I just installed R on a new Microsoft Windows 7 computer and I am running in the following error when using command line:

"C:\Program Files\R\R-3.3.2\bin\Rscript.exe" --version  
'C:\Program' is not recognized as an internal or external command,

operable program or batch file.

Note that I have added above the quotes around the path with a space. And that I have added in the system path:

;C:\Program Files\R\R-3.3.2\bin\

Interestingly:

  1. if I just call this Rscript.exe --version it gives the same error, which is very weird: if it finds it, why can't it run it!?! The only explanation I can find is that the error occurs when looking for a dependency of Rscript.exe
  2. I also noticed that this works "C:\Program Files\R\R-3.3.3\bin\x64\Rscript.exe" --version (both folders ...\bin and ...\bin\x64 have an executable Rscript.exe)

Finally I confirm it is an R specific question as all other executables I tried in a subfolder of Program Files can be called through the same command line interface!

like image 916
RockScience Avatar asked Oct 30 '22 00:10

RockScience


1 Answers

I have been trying to replicate your issue and I found one thing in your question: You mention that this does not work:

"C:\Program Files\R\R-3.3.2\bin\Rscript.exe" --version  
'C:\Program' is not recognized as an internal or external command,

But this does:

"C:\Program Files\R\R-3.3.3\bin\x64\Rscript.exe" --version

It seems that you are using R-3.3.3 in the example that works and R-3.3.2 in the example that does not.

So I would assume that if you change it to

"C:\Program Files\R\R-3.3.3\bin\Rscript.exe" --version  

it should work.

like image 183
clemens Avatar answered Nov 09 '22 12:11

clemens