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

前端 未结 8 1602
礼貌的吻别
礼貌的吻别 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:03

    Here is example:

    You have a.bat:

    @echo off
    if exist b.bat goto RUNB
    goto END
    :RUNB
    b.bat
    :END
    

    and b.bat called conditionally from a.bat:

    @echo off 
    echo "This is b.bat"
    

提交回复
热议问题