How do I launch multiple batch files from one batch file with dependency?

前端 未结 4 513
无人及你
无人及你 2021-01-05 17:45

I want to run one batch file, that start the other batch files. I looked at a similar question posted here: How to run multiple .BAT files within a .BAT file

I follo

4条回答
  •  执念已碎
    2021-01-05 18:39

    Answer:

    Add the /wait option to the start command.

    WAIT        Start application and wait for it to terminate.
    

    Example:

    start /wait cmd /k CALL D:\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\bin\run.bat
    
    start /wait cmd /k CALL batch1.bat
    
    start /wait cmd /k CALL batch2.bat
    
    start /wait cmd /k CALL batch3.bat
    

    Otherwise just use a ping delay between the starts. (See user706837's Answer)

    References:

    Technet, Rob, SS64, DosTips

提交回复
热议问题