In the above instance, I'd now have a console window with the window title of " c:\my dir\myfile.exe". If you omit it, you just open a CMD console box with the window named whatever you tried to launch. The first parameter of START is still the window name. You can't just use: START "c:\my dir\myfile.exe" The START program fixes that, but the old problem with START is still around. I have found that some of the programs I launch leave processes running, and the console window will not close until they terminate if I just run them by launching the executable. It also has some options that can be useful such as running the program minimized ( /min) or maximized ( /max), running it in low priority ( /low) and so on. As such, the batch processor continues on as expected. So what happens in this context is that the batch processor runs the start command which in turn runs the specified program and terminates (itself, not the spawned program). The start command is a built-in command that spawns a process (basically like running a program from the Start menu). start C:\Progra~2\Java\jre6\bin\javaw.exe -Xmx1024M -Xms1024M -jar Jilko.jar You can use something the following command instead, but the quotes are just easier and safer since shortnames are not guaranteed to be the same on every system. You can put something in there if you like or leave it empty, but if the command is in quotes, it must be present, otherwise the command-interpreter will treat the quoted command as the title and open a console that just sits there waiting for something to do. However it is only optional if the command is not in quotes otherwise is required. What you need to do to fix it, is to instruct the batch processor to launch the program and continue on without waiting as such: start "" "C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -Xmx1024M -Xms1024M -jar Jilko.jarĪs Terrance mentioned, the "" is the title to use for the console window. You can see this in action by exiting the Java program: the console window with the batch file then closes. Because the program is still running, the batch processor waits until the window is closed before moving on. If it were a tool that performs some action and then terminates, the batch file would continue on to the next command (or exit if there are no more). The problem you are experiencing is because the Java application you are launching (Jilko.jar) is a windowed program which continues to run even after the line that launches it. Each command is executed in turn and the batch processor waits for one command to finish before starting the next. Here is how it works a batch file is processed one line at a time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |