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

前端 未结 8 811
迷失自我
迷失自我 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:06

    This seems to happen from time to time with programs that are very sensitive to command lines, but one option is to just use the DOS path instead of the Windows path. This means that C:\Program Files\ would resolve to C:\PROGRA~1\ and generally avoid any issues with spacing.

    To get the short path you can create a quick Batch file that echos the short path:

    @ECHO OFF
    echo %~s1
    

    Which is then called as follows:

    C:\>shortPath.bat "C:\Program Files"
    C:\PROGRA~1
    

提交回复
热议问题