简体   繁体   English

ant命令后,BAT文件将不会启动另一个BAT文件

[英]BAT File will not start another BAT file after ant command

I have a .bat file that runs an ANT command like 我有一个运行ANT命令的.bat文件,例如

ant "clean" "debug" "compress" "buildnumber" -f C:\\Users\\cm\\WebstormProjects\\GAME\\build\\build.xml 蚂蚁“干净”“调试”“压缩”“内部编号” -f C:\\ Users \\ cm \\ WebstormProjects \\ GAME \\ build \\ build.xml

After this ant command I have this 这个蚂蚁命令后,我有这个

start run_vbs.bat 启动run_vbs.bat

and this command is not executed. 并且该命令未执行。

What am I doing wrong? 我究竟做错了什么?

Use this to start the ant batch file: 使用此命令来启动ant批处理文件:

call ant_batch.bat

It's likely that you aren't using the call keyword and so the batch file doesn't return control, it just ends. 您可能没有使用call关键字,因此批处理文件没有返回控制权,它只是结束了。

I had to call ant from my ant_batch.bat like this 我必须像这样从ant_batch.bat调用ant

call ant "clean" "debug" "compress" "buildnumber" -f C:\\Users\\cm\\WebstormProjects\\GAME\\build\\build.xml 呼叫蚂蚁“干净”“调试”“压缩”“内部编号” -f C:\\ Users \\ cm \\ WebstormProjects \\ GAME \\ build \\ build.xml

So it is necessary to use the keyword "call" while calling ant because the other commands that are after the ant-call will not be executed. 因此,在调用ant时必须使用关键字“ call”,因为蚂蚁调用之后的其他命令将不会执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM