Problem Executing Batch File in Pre-Build Event

前端 未结 8 1455
攒了一身酷
攒了一身酷 2021-02-20 01:05

I\'m trying to execute a batch file during a pre-build event. I have a new project and have added foo.bat to it. The file contains the following line:

8条回答
  •  遇见更好的自我
    2021-02-20 01:14

    The problem I suspect is that there's a SPACE character in your folder path.

    So this command will probably work for c:\development\projectABC\foo.bat but not for c:\development\project ABC\foo.bat

    At least that was the problem for me, there could be other issues, but I suspect this is the most common. The solution: put quotation marks around you batch call:

    "c:\development\project ABC\foo.bat"
    

提交回复
热议问题