Why does only the first line of this Windows batch file execute but all three lines execute in a command shell?

前端 未结 6 677
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 16:30

I have a batch file that executes three Maven commands, one after the other. Each command can be successfully executed in the script - by itself!. But when I add all three c

6条回答
  •  攒了一身酷
    2020-11-29 17:16

    Having call helps. However today it didn't.

    This is how I solved it:

    Bat file contents (if you want to stop batch when one of cmds errors)

    cmd1 && ^
    cmd2 && ^
    cmd3 && ^
    cmd4
    

    Bat file contents (if you want to continue batch when one of cmds errors)

    cmd1 & ^
    cmd2 & ^
    cmd3 & ^
    cmd4
    

提交回复
热议问题