1

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?

sanchop22
  • 2,729
  • 12
  • 43
  • 66
  • possible duplicate of [How to run multiple .BAT files within a .BAT file](http://stackoverflow.com/questions/1103994/how-to-run-multiple-bat-files-within-a-bat-file) – Jon Jun 18 '14 at 07:59

1 Answers1

3

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...
Jon
  • 428,835
  • 81
  • 738
  • 806