How do I run a batch script from within a batch script?

前端 未结 8 1611
礼貌的吻别
礼貌的吻别 2020-12-12 18:48

How do I call another batch script from within a batch script?

I want it to execute in an if statement.

8条回答
  •  遥遥无期
    2020-12-12 19:16

    If you wish to open the batch file in another window, use start. This way, you can basically run two scripts at the same time. In other words, you don't have to wait for the script you just called to finish. All examples below work:

    start batch.bat
    start call batch.bat
    start cmd /c batch.bat
    

    If you want to wait for the script to finish, try start /w call batch.bat, but the batch.bat has to end with exit.

提交回复
热议问题