Building a batch file to run exe files sequentially

前端 未结 4 1718
眼角桃花
眼角桃花 2021-01-12 01:21

I just start to learn how to build batch file. ( on the windows 7 environment)

I want to build the batch file which is able to run .exe files sequentially .

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 01:33

    start MyDriver.exe
    start YouDriver.exe
    start MySoftware.exe
    

    If you want the batch file in a different dir you would have to do:

    cd D:\
    start MyDriver.exe
    start YouDriver.exe
    start MySoftware.exe
    

    If you want a more flexible system:

    echo Welcome to EXE starter!
    set /p dir = DIR:
    set /p exe = EXE1:
    set /p exe1 = EXE2:
    set /p exe 2 = EXE3:
    cd DIR
    start exe
    start exe1
    start exe2
    

    There you go!

    To do it squentially:

    call YouDriver.exe
    call MeDriver.exe
    call Mysoftware.exe
    

    call will halt the batch file until program has closed.

提交回复
热议问题