Jump to content

So, I have been using my PC as a personal MC server for the past few weeks, and my friends and I love having it. However, I always have to manually turn it on to use it. I then went in to task scheduler and made a task to start the minecraftserver.exe file. However, when testing it, the window opens, then closes itself. I don't have much experience with automation, so do you guys have any ideas? All comments are appreciated  :)

“When life gives you lemons, don’t make lemonade. Make life take the lemons back! Get mad! I don’t want your damn lemons, what the hell am I supposed to do with these? Demand to see life’s manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I’m the man who’s gonna burn your house down! With the lemons! I’m gonna get my engineers to invent a combustible lemon that burns your house down!”

- Cave Johnson, founder and CEO of Aperture Science, in Portal 2

Link to comment
https://linustechtips.com/topic/397655-task-scheduler-automation/
Share on other sites

Link to post
Share on other sites

I would suggest download the server.jar and run it with a batch file.

 

Put the server.jar in the same location as the executable.

then create a text file containing the following

java -jar minecraft_server.jar nogui

Then save the text file as "start.bat" in the same location as the exe and jar files.

Then use task scheduler to start the batch file instead of the executable.

 

Just remember not to close the command prompt window or the server will stop.

One Steam to rule them all, One Sale to find them, One Sale to bring them all and with their wallets, bind them! - r/pcmasterrace 17/01/2014

Spoiler
  • CPU: Intel Core i7 6700k
  • CPU Cooler: CM Hyper 212+ 
  • RAM: 16GB Kingston HyperX Fury 2400Mhz (2x8GB)
  • GPU: Gigabyte G1 R9 390 
  • Mobo: Asus Z170-AR
  • PSU: Antec High Current Gamer 900W 
  • Storage: 240GB intel 520 SSD (OS), Sandisk 128GB SSD(Other OS) 2x 2TB Seagate Barracuda 
  • Case: Fractal Design R4

 

Link to post
Share on other sites

I would suggest download the server.jar and run it with a batch file.

 

Put the server.jar in the same location as the executable.

then create a text file containing the following

java -jar minecraft_server.jar nogui

Then save the text file as "start.bat" in the same location as the exe and jar files.

Then use task scheduler to start the batch file instead of the executable.

 

Just remember not to close the command prompt window or the server will stop.

Thanks, that bat file works, but when I try to open it with task scheduler it closes itself again. Anything else?

“When life gives you lemons, don’t make lemonade. Make life take the lemons back! Get mad! I don’t want your damn lemons, what the hell am I supposed to do with these? Demand to see life’s manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I’m the man who’s gonna burn your house down! With the lemons! I’m gonna get my engineers to invent a combustible lemon that burns your house down!”

- Cave Johnson, founder and CEO of Aperture Science, in Portal 2

Link to post
Share on other sites

edit your batch file and put the word pause on the line underneath so it will look like

java -jar minecraft_server.jar noguipause

Then run the batch file and then address what ever issue the server is having running. Probably missing eula.txt if i had to guess.

One Steam to rule them all, One Sale to find them, One Sale to bring them all and with their wallets, bind them! - r/pcmasterrace 17/01/2014

Spoiler
  • CPU: Intel Core i7 6700k
  • CPU Cooler: CM Hyper 212+ 
  • RAM: 16GB Kingston HyperX Fury 2400Mhz (2x8GB)
  • GPU: Gigabyte G1 R9 390 
  • Mobo: Asus Z170-AR
  • PSU: Antec High Current Gamer 900W 
  • Storage: 240GB intel 520 SSD (OS), Sandisk 128GB SSD(Other OS) 2x 2TB Seagate Barracuda 
  • Case: Fractal Design R4

 

Link to post
Share on other sites

edit your batch file and put the word pause on the line underneath so it will look like

java -jar minecraft_server.jar noguipause

Then run the batch file and then address what ever issue the server is having running. Probably missing eula.txt if i had to guess.

No the server works on it's own, but not when it is used through task manager, as this happens with other programs as well

“When life gives you lemons, don’t make lemonade. Make life take the lemons back! Get mad! I don’t want your damn lemons, what the hell am I supposed to do with these? Demand to see life’s manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I’m the man who’s gonna burn your house down! With the lemons! I’m gonna get my engineers to invent a combustible lemon that burns your house down!”

- Cave Johnson, founder and CEO of Aperture Science, in Portal 2

Link to post
Share on other sites

PROBLEM SOLVED!!!!

I had to tell task scheduler to run the .bat file under my server directory. Once running the .bat file, it told me it didn't have access to the .jar file, and then it hit me. Thank you very much for that .bat file though, as I plan to use that from now on.

“When life gives you lemons, don’t make lemonade. Make life take the lemons back! Get mad! I don’t want your damn lemons, what the hell am I supposed to do with these? Demand to see life’s manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I’m the man who’s gonna burn your house down! With the lemons! I’m gonna get my engineers to invent a combustible lemon that burns your house down!”

- Cave Johnson, founder and CEO of Aperture Science, in Portal 2

Link to post
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

×