批处理脚本运行多个JAR文件一次 [英] Batch Script Run Multiple Jar Files At once

查看:1424
本文介绍了批处理脚本运行多个JAR文件一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个批处理文件,我想一次运行。所以我写了这一点:

 关闭@echo
Java的罐子happyjar.jar
Java的罐子sadjar.jar
暂停

当我运行该脚本,它第一次运行happyjar,然后运行sadjar。是否有可能不运行多个批处理文件运行一次两个罐子?


解决方案

 关闭@echo
启动标题1Java的罐子happyjar.jar
启动标题2Java的罐子sadjar.jar
暂停

借助开始命令在新的窗口中运行你的命令,因此,所有3个命令将异步运行。

不要加/ wait选项,否则会等待这个新窗口中才去下一个命令完成。

I have two batch files which I would like to run at once. So I wrote this:

@echo off
java -jar happyjar.jar
java -jar sadjar.jar
pause

When I run the script, it first runs happyjar, then runs sadjar. Is it possible to run both jars at once without running multiple batch files?

解决方案

@echo off
start "Title1" java -jar happyjar.jar
start "Title2" java -jar sadjar.jar
pause

The start command runs your command in a new window, so all 3 commands would run asynchronously.

Don't add /wait option, otherwise it will wait for this new window to complete before going to the next command.

这篇关于批处理脚本运行多个JAR文件一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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