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

前端 未结 6 714
伪装坚强ぢ
伪装坚强ぢ 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:09

    Try writing the following batch file and executing it:

    Echo one
    cmd
    Echo two
    cmd
    Echo three
    cmd
    

    Only the first two lines get executed. But if you type "exit" at the command prompt, the next two lines are processed. It's a shell loading another.

    To be sure that this is not what is happening in your script, just type "exit" when the first command ends.

    HTH!

提交回复
热议问题