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

前端 未结 17 1654
别跟我提以往
别跟我提以往 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:28

    I know I am a bit late to the party, but here is another way. That is, this method should wait until the first one is done, the second, and so on.

    start "" /wait cmd.exe /c msbuild.bat
    start "" /wait cmd.exe /c unit-tests.bat
    start "" /wait cmd.exe /c deploy.bat
    

    The only issue that may come out of using this method, is that with new instances of cmd.exe being spawned, is that Errorlevel checking is kept within in each instance of cmd.exe.

    Or..

    start "" /wait call msbuild.bat
    start "" /wait call unit-tests.bat
    start "" /wait call deploy.bat
    

    Hope this helps.

提交回复
热议问题