Hi everyone,
I'm new on the forums, so if I'm not in the right place or my question is already asked ; please be indulgent
So for start my minecrfat server, i must execute 4 commands in the command prompt of windows.
So I asking myself is I can creat a rainmeter icon who can run this 4 commands ?
The idea is to click one time on a custom rainmeter icon for launch my server.
Thank for your help !
It is currently May 2nd, 2024, 4:48 am
execute multi cmd
-
- Posts: 8
- Joined: February 21st, 2020, 6:02 pm
execute multi cmd
Last edited by Dishark on February 21st, 2020, 9:53 pm, edited 1 time in total.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: execute multi cmd
LeftMouseUpAction=["command1.exe"][!Delay 1000]["command2.exe"][!Delay 1000]["command3.exe"][!Delay 1000]["command4.exe"]Dishark wrote: ↑February 21st, 2020, 6:09 pm Hi everyone,
I'm new on the forums, so if I'm not in the right place or my question is already asked ; please be indulgent
So for start my minecrfat server, i must execute 4 commands in the command prompt of windows.
So I asking myself is I can creat a rainmeter icon who can run this 4 commands ?
The idea is to click one time on a custom rainmeter icon for launch my server.
Thank for your help !
This assumes you want a little delay between each command to give them time to run before executing the next one. You can play with the values for the !Delay bangs, or even remove them if they are not needed.
https://docs.rainmeter.net/manual/bangs/#Delay
-
- Posts: 8
- Joined: February 21st, 2020, 6:02 pm
Re: execute multi cmd
Maybe I'm wrong with the syntax but I try like that and it don't work
So i try with ".exe" at the end but it's the same
I show you my command, it's can help
cd..
J:
cd J:\Minecraft\SERVEUR\1.14.4
java -Xmx4G -jar mojang_1.14.4.jar
Code: Select all
LeftMouseUpAction=["cd.."][!Delay 1000]["J:"][!Delay 1000]["cd J:\Minecraft\SERVEUR\1.14.4"][!Delay 1000]["java -Xmx4G -jar mojang_1.14.4.jar"]
I show you my command, it's can help
cd..
J:
cd J:\Minecraft\SERVEUR\1.14.4
java -Xmx4G -jar mojang_1.14.4.jar
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: execute multi cmd
Yeah, those DOS / cmd commands are not going to work this way. My advice is to create a .bat batch file, and just execute that.Dishark wrote: ↑February 21st, 2020, 6:28 pm Maybe I'm wrong with the syntax but I try like that and it don't work
So i try with ".exe" at the end but it's the sameCode: Select all
LeftMouseUpAction=["cd.."][!Delay 1000]["J:"][!Delay 1000]["cd J:\Minecraft\SERVEUR\1.14.4"][!Delay 1000]["java -Xmx4G -jar mojang_1.14.4.jar"]
I show you my command, it's can help
cd..
J:
cd J:\Minecraft\SERVEUR\1.14.4
java -Xmx4G -jar mojang_1.14.4.jar
I would think in that case that you might want to use Start to launch java.
-
- Rainmeter Sage
- Posts: 7185
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: execute multi cmd
You can follow jsmorley's advice, and assuming you make the batch file correctly, it will work. One other solution is to use fully qualified paths when executing things. So, even though I'm not familiar with your setup and I never played Minecraft:Dishark wrote: ↑February 21st, 2020, 6:28 pm Maybe I'm wrong with the syntax but I try like that and it don't work
So i try with ".exe" at the end but it's the sameCode: Select all
LeftMouseUpAction=["cd.."][!Delay 1000]["J:"][!Delay 1000]["cd J:\Minecraft\SERVEUR\1.14.4"][!Delay 1000]["java -Xmx4G -jar mojang_1.14.4.jar"]
I show you my command, it's can help
cd..
J:
cd J:\Minecraft\SERVEUR\1.14.4
java -Xmx4G -jar mojang_1.14.4.jar
- java is probably the Java Runtime Environment in your OS, so it will probably have a fully qualified path of, say, c:\Program Files\Java\jre1.8.0_191\bin\java.exe
- the -Xmx4G -jar are most likely the arguments that java.exe is using, so no change should be required
- the mojang_1.14.4.jar part is probably a file in the J:\Minecraft\SERVEUR\1.14.4 folder, so the fully qualified path for that would be J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar
All these things considered, I think you might have more success using a single command in the LeftMouseUpAction, something along the lines of:
Code: Select all
LeftMouseUpAction=["c:\Program Files\Java\jre1.8.0_191\bin\java.exe -Xmx4G -jar J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar"]
- you should replace the 1.8.0_191 version of JRE with JRE's version number on your system - just look in C:\Program Files\Java to see it
- if this doesn't work from the start, you might want to add appropriate (single/double, can't remember which) quotes to enclose the fully qualified paths that have spaces in their names
- I don't know if that's the case, but JRE would possibly want to run in an appropriate "starting folder". If so, you may want to change your approach a bit and use the RunCommand plugin's StartInFolder option, instead of plain execution of the program
-
- Posts: 8
- Joined: February 21st, 2020, 6:02 pm
Re: execute multi cmd
I first tried to do 4 .bat file with my "commands' but it didn't work. It's open 4 windows of cmd prompt.
So I researched on the internet how to creat a .bat file correctly I don't find solutions for my configuration.
So I goback to rainmeter forum and I saw your messages Yincognito.
For explain what I know it's just for allocate 4Go of RAM for my server. By default it's 500mb and I don't know how to set 4Go by default.
So, for me, the only way to run my server at 4Go it's to execute this commands in windows prompt.
Until I figure out how to make right .bat file or change the default RAM I use windows prompt and write 4 commands or
and I don't have my 4Go of RAM (but when there are 2-3 players it's work)
Thank guys for your help !
I need to deepen my knowledge in .bat file or setup mc sever with Paper
So I researched on the internet how to creat a .bat file correctly I don't find solutions for my configuration.
So I goback to rainmeter forum and I saw your messages Yincognito.
For explain what I know
Code: Select all
-Xmx4G -jar
So, for me, the only way to run my server at 4Go it's to execute this commands in windows prompt.
Until I figure out how to make right .bat file or change the default RAM I use windows prompt and write 4 commands or
Code: Select all
LeftMouseUpAction=[J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar]
Thank guys for your help !
I need to deepen my knowledge in .bat file or setup mc sever with Paper
-
- Rainmeter Sage
- Posts: 7185
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: execute multi cmd
I see. That's odd, as Rainmeter barely takes a couple of MB of RAM, so it should have no problem in executing the command and still allow the program to use the 4GB of RAM available. Building a batch file is quite easy, for non-complex situations all you have to do is write the CMD commands separated by Enter and that's it.Dishark wrote: ↑February 21st, 2020, 8:30 pm I first tried to do 4 .bat file with my "commands' but it didn't work. It's open 4 windows of cmd prompt.
So I researched on the internet how to creat a .bat file correctly I don't find solutions for my configuration.
So I goback to rainmeter forum and I saw your messages Yincognito.
For explain what I knowit's just for allocate 4Go of RAM for my server. By default it's 500mb and I don't know how to set 4Go by default.Code: Select all
-Xmx4G -jar
So, for me, the only way to run my server at 4Go it's to execute this commands in windows prompt.
Until I figure out how to make right .bat file or change the default RAM I use windows prompt and write 4 commands or
and I don't have my 4Go of RAM (but when there are 2-3 players it's work)Code: Select all
LeftMouseUpAction=[J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar]
Thank guys for your help !
I need to deepen my knowledge in .bat file or setup mc sever with Paper
Too bad I can't replicate your setup and see why it isn't working, as this should be trivial to accomplish, really...
EDIT: Maybe you coud make one last attempt, by putting this in the skin:
Code: Select all
LeftMouseUpAction=['"c:\Program Files\Java\jre1.8.0_191\bin\java.exe" -Xmx4G -jar "J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar"']
Code: Select all
LeftMouseUpAction=["c:\Program Files\Java\jre1.8.0_191\bin\java.exe" "-Xmx4G -jar J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar"]
Code: Select all
LeftMouseUpAction=['"c:\Program Files\Java\jre1.8.0_191\bin\java.exe" "-Xmx4G -jar J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar"']
Last edited by Yincognito on February 21st, 2020, 9:02 pm, edited 1 time in total.
-
- Posts: 8
- Joined: February 21st, 2020, 6:02 pm
Re: execute multi cmd
I tried this but it's doesn't work
Code: Select all
cmd cd..
cmd J:
cmd cd J:\Minecraft\SERVEUR\1.14.4
cmd java -Xmx8G -jar mojang_1.14.4.jar
-
- Rainmeter Sage
- Posts: 7185
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: execute multi cmd
No. You don't have to write cmd in front of each command, as the batch (i.e. the .bat file) already runs in the CMD environment. Other than that, you do things in the wrong order - it should be something like:Dishark wrote: ↑February 21st, 2020, 8:53 pm I tried this but it's doesn't work
Code: Select all
cmd cd.. cmd J: cmd cd J:\Minecraft\SERVEUR\1.14.4 cmd java -Xmx8G -jar mojang_1.14.4.jar
Code: Select all
"c:\Program Files\Java\jre1.8.0_191\bin\java.exe" -Xmx8G -jar "J:\Minecraft\SERVEUR\1.14.4\mojang_1.14.4.jar"
I don't have a mojang file on my system, so I get an error that java can't find it, but the above should work in your case. Just paste the above line in a .bat file you create (say, on the desktop, for simplicity) and see if it does the job. Be sure to replace the jre1.8.0_191 part according to the java version in your system.
-
- Posts: 8
- Joined: February 21st, 2020, 6:02 pm
Re: execute multi cmd
I tried my best for copy paste your commands without syntaxes issues and it didn't work
I checked my java folder and i saw
So I re-try with changing 191 by 181 and it still hasn't worked
I appreciate your help, really, but I don't know what to do
Is there a way to see why the commands don't run successfully ?
I checked my java folder and i saw
Code: Select all
jre1.8.0_181
I appreciate your help, really, but I don't know what to do
Is there a way to see why the commands don't run successfully ?