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

前端 未结 4 512
无人及你
无人及你 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:27

    There are multiple ways for that.
    
    1.
    
    rem echo call A
    
    CALL a.bat
    
    rem echo call B
    
    CALL b.bat
    
    rem echo call C
    
    CALL c.bat
    
    rem pause
    
    --------------------
    
    2.
    
    echo call A
    
    start cmd /k CALL a.bat
    
    
    echo call B
    
    start cmd /k CALL b.bat
    
    echo call C
    
    start cmd /k CALL c.bat
    
    pause
    
    ---------------------
    
    Here the difference is-
    
    start cmd /k
    
       It creates these many instances. So we can see multiple number of CMD prompts.
    
    
    CALL
    
       Each descendent CALL waits for the completion of the previous CALL.
    

提交回复
热议问题