Building a batch file to run exe files sequentially

前端 未结 4 1702
眼角桃花
眼角桃花 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:45

    You actually don't need to do anything special to make this happen; batch files are synchronous by default, so execution of the batch file will pause when an executable is launched, and resume when it exits. Something as simple as this should do:

    @echo off
    REM "@echo off" prevents each line from being printed before execution,
    REM and is optional
    REM "REM" introduces a comment line
    D:\MyDriver.exe
    D:\YouDriver.exe
    D:\MySoftware.exe
    

    Of course, if you're interested in checking the return values of the programs, to see whether they succeeded or failed to install (assuming the installer provides that information), then things become slightly more complicated; if that's what you need, mention it in a comment, and I'll expand my answer accordingly.

提交回复
热议问题