sanchop22
sanchop22

Reputation: 2809

running bat file inside bat file

The script after fourth line does not run. If i comment out the fourth line, all commands work. I think script switches to dx.bat file and does not return to caller bat. Here is the script:

set ref_path=C:\Users\xyz\Desktop\

cd C:\android-sdk\sdk\build-tools\android-4.4.2
dx.bat --dex --verbose --core-library --output=%ref_path%classes.zip %ref_path%tmp\classes

cd C:\Users\xyz\Desktop\

7z x C:\Users\xyz\Desktop\SP.war -oC:\Users\xyz\Desktop\SP -r -y

How can I make this script work?

Upvotes: 1

Views: 1616

Answers (1)

Jon
Jon

Reputation: 437336

By default, calling a batch file from inside another does not return execution to the parent after the child is finished running.

To change this and get the expected behavior you need to use the CALL command:

CALL dx.bat ...parameters...

Upvotes: 3

Related Questions