Open with fichier.bat
Solved
SamaRive
-
SamaRive -
SamaRive -
Hello,
I have a slight problem regarding the execution of .jar files on Windows 10. I know that the error does not come from my code, as everything works when I enter the command "java -jar" in the Windows prompt.
While searching online, I couldn't find any similar cases to mine. I had an idea at that moment: what if I created a small code that runs with a .jar and uses "java -jar"! Hence my question: is there a command to manage the "open with" feature in batch?
My final goal is to be able to do:
-right click on "programme.jar"
-open with "code.bat"
-be able to use "programme.jar"
I have no idea if this is possible, as I have no experience with batch, but anyway, thank you in advance to everyone who takes the time to help me!
Configuration: Windows / Edge 16.16299
I have a slight problem regarding the execution of .jar files on Windows 10. I know that the error does not come from my code, as everything works when I enter the command "java -jar" in the Windows prompt.
While searching online, I couldn't find any similar cases to mine. I had an idea at that moment: what if I created a small code that runs with a .jar and uses "java -jar"! Hence my question: is there a command to manage the "open with" feature in batch?
My final goal is to be able to do:
-right click on "programme.jar"
-open with "code.bat"
-be able to use "programme.jar"
I have no idea if this is possible, as I have no experience with batch, but anyway, thank you in advance to everyone who takes the time to help me!
Configuration: Windows / Edge 16.16299
2 réponses
Hello
Normally, by creating another .bat named... launch jar program (in my greatest inspiration), with inside:
It should work, right?
The GAFAM don't have oil but they have data!
Do you feel my Big Data?
A people sacrificing its freedoms for a little more security loses them all.
ALL YOUR DATABASE ARE BELONG TO US
Normally, by creating another .bat named... launch jar program (in my greatest inspiration), with inside:
start java -jar programme.jar
It should work, right?
The GAFAM don't have oil but they have data!
Do you feel my Big Data?
A people sacrificing its freedoms for a little more security loses them all.
ALL YOUR DATABASE ARE BELONG TO US
Indeed, it turns out that I have a good ten .jar files that I run quite often, and my main problem is to create a script that could launch the file I want to execute without having to modify the content of the same script. Unless I haven't quite understood, it seems to me that the code you advised me can only execute "programme.jar" and not, for example, "programme1.jar". I'm sorry if all this is a bit confusing, thank you anyway for taking the time to help me!
Yes, that's it.
To know that this command exists but I forgot it.
Otherwise, there's another way ;-)
To know that this command exists but I forgot it.
Otherwise, there's another way ;-)