adragomir Posted July 19, 2022 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
Solution Luke94 Posted July 19, 2022 Solution 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
adragomir Posted July 19, 2022 Author 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!
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