How to run multiple .BAT files within a .BAT file

前端 未结 17 1684
别跟我提以往
别跟我提以往 2020-11-22 13:59

I\'m trying to get my commit-build.bat to execute other .BAT files as part of our build process.

Content of commit-build.bat:



        
17条回答
  •  逝去的感伤
    2020-11-22 14:17

    With correct quoting (this can be tricky sometimes):

    start "" /D "C:\Program Files\ProgramToLaunch" "cmd.exe" "/c call ""C:\Program Files\ProgramToLaunch\programname.bat"""
    

    1st arg - Title (empty in this case)
    2nd arg - /D specifies starting directory, can be ommited if want the current working dir (such as "%~dp0")
    3rd arg - command to launch, "cmd.exe"
    4th arg - arguments to command, with doubled up quotes for the arguments inside it (this is how you escape quotes within quotes in batch)

提交回复
热议问题