Reputation: 193
I have a program that creates a batch file which in turn runs the program on startup. I want to hide the batch file so that all the user sees is the java program open, not the console window in the background.
EDIT: It seems that I'm not being clear. Here is the code in the batch file:
cd C:\Java\jre8
javaw -jar C:/Users/Me/Desktop/MyProgram.jar
I only need to hide the batch file.
Upvotes: 1
Views: 6089
Reputation: 7599
javaw seems to be what you are looking for: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html
The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.
If you are looking to hide the windows .bat console, you can use vbs -- take a look at this page for various options for doing this: https://superuser.com/questions/62525/run-a-completly-hidden-batch-file .
Upvotes: 5