我如何从依赖一批文件,启动多个批处理文件? [英] How do I launch multiple batch files from one batch file with dependency?

查看:99
本文介绍了我如何从依赖一批文件,启动多个批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要运行一个批处理文件,即启动其他批处理文件。我看着这里发布一个类似的问题:<一href=\"http://stackoverflow.com/questions/1103994/how-to-run-multiple-bat-files-within-a-bat-file\">How以一个bat文件内运行多个批处理文件

我跟着例子(特别是最后建议)和它的工作...部分。它没有推出,我需要批处理文件。然而,为了使应用程序能够正常运行,一些批处理文件要打开,然后自生自灭了几秒钟,下下批处理文件发布之前,否则他们将无法注册。具体而言,第一批处理文件启动Web应用程序服务器(JBOSS 5.1),那么下一个批处理文件打开一个池管理器,那么其它两个发射分发服务器。当我运行调用别人我的批处理文件,他们都发布几乎同时,他们不注册对方。我可以甚至一个批处理文件做到这一点?还是我去到另一个批处理文件的code和做出改变呢?我想避免这种不惜一切代价。

下面是我到目前为止有:

  CMD启动/ K CALL D:\\ jboss的-5.1.0.GA-JDK6 \\ jboss-5.1.0.GA \\ BIN \\的run.bat启动CMD / K CALL batch1.bat启动CMD / K CALL batch2.bat启动CMD / K CALL batch3.bat


解决方案

您可以删除启动CMD / K ,只使用呼叫

  CALL D:\\ jboss的-5.1.0.GA-JDK6 \\ jboss-5.1.0.GA \\ BIN \\的run.bat
CALL batch1.bat
CALL batch2.bat
CALL batch3.bat

I want to run one batch file, that start the other batch files. I looked at a similar question posted here: How to run multiple bat files within a bat file

I followed the example (specifically the very last suggestion) and it worked...partially. It did launch the batch files that I needed to. However, in order for the applications to function properly, some of these batch files have to open, and then run their course for a few seconds, before the next the next batch file launches, otherwise they won't be registered. Specifically, the first batch file launches a web applications server (JBOSS 5.1), then the next batch file opens a pool manager, then the other two launch distribution servers. When I run my batch file that calls the others, they all launch nearly simultaneously, and they do not register each other. Can I even do this with a batch file? Or do I have to go into the code of the other batch files and make changes there? I want to avoid that at all costs.

Here is what I have so far:

start cmd /k CALL D:\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\bin\run.bat

start cmd /k CALL batch1.bat

start cmd /k CALL batch2.bat

start cmd /k CALL batch3.bat

解决方案

You can drop the start cmd /k and just use CALL.

CALL D:\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\bin\run.bat
CALL batch1.bat
CALL batch2.bat
CALL batch3.bat

这篇关于我如何从依赖一批文件,启动多个批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆