2

I have a small Windows batch script that is executed from within a game application (the user experience is important here) that is called to start a Java program among other things. With the command javaw I hide console output from the user of the game to improve experience, however, the console window remains open from the batch file execution and doesn't close until the Java code is finished executing.

The first solution I tried was to use the start command, but I am unable to pass any parameters to the java program and it fails accordingly.

start javaw -jar jar-file-here.jar args...

How should I write a batch file that will start a Java program with the correct variables, and close without waiting for Java to close?

Edit: My parameters contain quotes ( " ), so I am unable to contain them all in quotes without confusing the command.

Bit Fracture
  • 651
  • 1
  • 9
  • 24
  • Why can't you pass the required variables? START takes a parameters list http://ss64.com/nt/start.html – Jacob Krall Jan 12 '13 at 23:42
  • The parameters are not passing, I get errors like this in a dialog window: [-Xincgc] Windows cannot find '-Xincgc'. Make sure you typed the name correctly, and then try again. --- This is one of the variables I passed in the command line, by the way. – Bit Fracture Jan 12 '13 at 23:47
  • 1
    Fixed. I just needed the "title" part before the actual app path. Thanks for the help guys. – Bit Fracture Jan 12 '13 at 23:59
  • possible duplicate of [Start a java program without the console](http://stackoverflow.com/questions/5710839/start-a-java-program-without-the-console) – Kieveli Aug 14 '13 at 18:27

1 Answers1

0

The first argument accepts a window title. Here is the command with the adjustment made:

start "Window Title Here" javaw -jar jar-file-here.jar args...

Bit Fracture
  • 651
  • 1
  • 9
  • 24