views:

2749

answers:

3

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

SOLUTION: 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]

@echo on

this opens, runs all the commands and closes the window, does not wait for the command to finish.

+5  A: 

Try:

javaw <args>
McDowell
works if I type the command into the console window individually. If the 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
Virat Kadaru
+2  A: 

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.

Virat Kadaru
A: 

Alright after tring and cring, here goes my soluction

@echo off
start /B javaw -jar -Xms16m -Xmx512m client.jar
@echo on

I hope it will be usefull for somebody.

Tiago Lopes da Costa