adragomir Posted July 19, 2022 Share Posted July 19, 2022 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, Aurelian Link to comment Share on other sites More sharing options...
Solution Luke94 Posted July 19, 2022 Solution Share Posted July 19, 2022 (edited) ShellExecute(@ScriptDir & "\jvm\bin\java.exe","-jar " & @ScriptDir & "\learnLambda-1.0.jar", "", "", @SW_HIDE); or Run(@ComSpec & " /c " & ".\jvm\bin\java.exe -jar " & ".\learnLambda-1.0.jar", "", @SW_HIDE); Edit: @SW_HIDE belongs in the 5th parameter of ShellExecute. Edited July 19, 2022 by Luke94 adragomir 1 Link to comment Share on other sites More sharing options...
adragomir Posted July 19, 2022 Author Share Posted July 19, 2022 53 minutes ago, Luke94 said: ShellExecute(@ScriptDir & "\jvm\bin\java.exe","-jar " & @ScriptDir & "\learnLambda-1.0.jar", "", "", @SW_HIDE); or 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now