BAT文件不会在ant命令之后再启动另一个BAT文件

时间:2021-09-12 16:03:18

I have a .bat file that runs an ANT command like

我有一个.bat文件,它运行类似ANT的命令

ant "clean" "debug" "compress" "buildnumber" -f C:\Users\cm\WebstormProjects\GAME\build\build.xml

蚂蚁“干净”的“调试”“压缩”“buildnumber”- f C:\Users\cm\ WebstormProjects \ \制造\ 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?

我做错了什么?

2 个解决方案

#1


3  

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关键字,所以批处理文件不会返回控件,它只会结束。

#2


1  

I had to call ant from my ant_batch.bat like this

我不得不从ant_batch中调用ant。这样的蝙蝠

call ant "clean" "debug" "compress" "buildnumber" -f C:\Users\cm\WebstormProjects\GAME\build\build.xml

叫蚂蚁“干净”的“调试”“压缩”“buildnumber”- f C:\Users\cm\ WebstormProjects游戏\ \制造\ 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”,因为ant调用之后的其他命令将不会执行。

#1


3  

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关键字,所以批处理文件不会返回控件,它只会结束。

#2


1  

I had to call ant from my ant_batch.bat like this

我不得不从ant_batch中调用ant。这样的蝙蝠

call ant "clean" "debug" "compress" "buildnumber" -f C:\Users\cm\WebstormProjects\GAME\build\build.xml

叫蚂蚁“干净”的“调试”“压缩”“buildnumber”- f C:\Users\cm\ WebstormProjects游戏\ \制造\ 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”,因为ant调用之后的其他命令将不会执行。