Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the .bat file skips lines and jumps to the end?

My .bat file is as follows:

@echo on
cd %1\%2
copy D:\source\Meep\bat\ant.properties .\
android update project -p .\ 
ant clean
ant release

When I start the bat file, it ran correctly up to the line android update project -p .\ and then it jumped to the end skipping the lines ant clean and ant release.

Following were printed out in the console:

D:\>cd D:\source\Meep\Meep\trunk\MeepApp

D:\source\Meep\Meep\trunk\MeepApp>copy D:\source\Meep\bat\ant.properties .\
已复制         1 个文件。

D:\source\Meep\Meep\trunk\MeepApp>android update project -p .\
Updated local.properties
Updated file D:\source\Meep\Meep\trunk\MeepApp\proguard-project.txt

D:\source\Meep\Meep\trunk\MeepApp>

Why is that? And please tell me how to run the whole bat commands. Thanks very much.

Note: it ran OK when I entered commands on CMD one by one.

like image 669
Aaron Lee Avatar asked Jan 14 '23 05:01

Aaron Lee


1 Answers

android is a .bat file and invoking a .bat from another without stopping the first one requires call:

call android update project -p .\

More information: How to run multiple .BAT files within a .BAT file

like image 182
laalto Avatar answered Jan 17 '23 17:01

laalto