启动的.jar命令行参数的文件(但没有控制台窗口) [英] Launch .jar files with command line arguments (but with no console window)
问题描述
我要做一个应用程序的演示,应用程序有一个的server.jar和client.jar中。两者都有命令行参数和可执行。我需要启动的server.jar的两个实例和client.jar的两个实例。
我认为使用批处理文件是要走的路,但是,该批处理文件执行的第一个命令(即> server.bat [参数1] [参数2]),除非我关闭第一个实例不会做任何事情,在这种情况下,它然后运行第二命令。也是我不想一个空白的控制台窗口中打开(或最小化)
我真正需要的是一个批处理脚本,将只需启动这些应用程序没有任何控制台窗口,并启动我需要的所有实例。
先谢谢了!
编辑:
javaw进程
工作,如果我键入命令
进入单独的控制台窗口。
如果我把同样的批处理文件,
它会像以前一样的行为。安慰
窗口打开后,一个实例启动
(是先到者为准),它不
进一步进行,除非我关闭
应用在这种情况下,它运行第二命令。我希望它静默运行的所有命令
块引用>解决方案找到了解决办法,下面是我的批处理文件的内容
关闭@echo启动/ B的server.jar [ARG1] [ARG2]
启动/ B的server.jar [参数3] [ARG4]启动/ B client.jar中[arg5]
启动/ B client.jar中[arg6]在@echo这将打开,运行的所有命令和关闭该窗口,不会等待命令完成。
我仍然不知道如何prevent从完全打开窗户。
I have to do a demo of an application, the application has a server.jar and client.jar. Both have command line arguments and are executable. I need to launch two instances of server.jar and two instances of client.jar.
I thought that using a batch file was the way to go, but, the batch file executes the first command (i.e. >server.bat [argument1] [argument2]) and does not do anything else unless I close the first instance, in which case it then runs the 2nd command. And also the I do not want a blank console window to open (or be minimized)
What I really need is a batch script that will just launch these apps without any console windows and launch all instances that I need.
Thanks in Advance!
EDIT:
javaw:
works if I type the command into the console window individually. If I put the same in the batch file, it will behave as before. Console window opens, one instance starts (whichever was first) and it does not proceed further unless I close the application in which case it runs the 2nd command. I want it to run all commands silently
解决方案Found the solution, below is the contents of my batch file
@echo off start /B server.jar [arg1] [arg2] start /B server.jar [arg3] [arg4] start /B client.jar [arg5] start /B client.jar [arg6] @echo on
this opens, runs all the commands and closes the window, does not wait for the command to finish.
I am still not sure how to prevent the window from opening completely.
这篇关于启动的.jar命令行参数的文件(但没有控制台窗口)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!