Command Prompt Error 'C:\Program' is not recognized as an internal or external command, operable program or batch file

前端 未结 8 768
迷失自我
迷失自我 2020-12-01 07:04

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

相关标签:
8条回答
  • 2020-12-01 08:07

    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.

    0 讨论(0)
  • 2020-12-01 08:08

    Go to Start and search for cmd. Right click on it, properties then set the Target path in quotes. This worked fine for me.

    0 讨论(0)
提交回复
热议问题