How to create batch file in Windows using “start” with a path and command with spaces

前端 未结 7 1567
孤独总比滥情好
孤独总比滥情好 2020-11-27 12:54

I need to create a batch file which starts multiple console applications in a Windows .cmd file. This can be done using the start command.

However, the command has

7条回答
  •  天涯浪人
    2020-11-27 13:24

    Actually, his example won't work (although at first I thought that it would, too). Based on the help for the Start command, the first parameter is the name of the newly created Command Prompt window, and the second and third should be the path to the application and its parameters, respectively. If you add another "" before path to the app, it should work (at least it did for me). Use something like this:

    start "" "c:\path with spaces\app.exe" param1 "param with spaces"
    

    You can change the first argument to be whatever you want the title of the new command prompt to be. If it's a Windows app that is created, then the command prompt won't be displayed, and the title won't matter.

提交回复
热议问题