Jump to content

How to run java -jar ... but hide the cmd?

Go to solution Solved by Luke94,

Recommended Posts

Hi guys,


I'm trying to run a java -jar command but unfortunatelly the cmd also opens and stays open.  I want to hide the cmd basically.

I have tried:

ShellExecute(@ScriptDir & "\jvm\bin\java.exe","-jar " & @ScriptDir & "\learnLambda-1.0.jar", @SW_HIDE);

Run(@ComSpec & " /c  " & ".\jvm\bin\java.exe -jar " & ".\learnLambda-1.0.jar");


You also have a picture of how the running app looks.


Is it possible to force hide the cmd or something?


Kind regards,






Link to comment
Share on other sites

53 minutes ago, Luke94 said:
ShellExecute(@ScriptDir & "\jvm\bin\java.exe","-jar " & @ScriptDir & "\learnLambda-1.0.jar", "", "", @SW_HIDE);


Run(@ComSpec & " /c  " & ".\jvm\bin\java.exe -jar " & ".\learnLambda-1.0.jar", "", @SW_HIDE);

Edit: @SW_HIDE belongs in the 5th parameter of ShellExecute.


Thanks Luke95, 

Run(@ComSpec & " /c  " & ".\jvm\bin\java.exe -jar " & ".\learnLambda-1.0.jar", "", @SW_HIDE); 

works very well. Cheers!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...