1
votes

I'm trying to setup a server for Minecraft Forge 1.7.2 for the first time. When I run the server straight from the jar, it works perfectly fine. However, I like to use a batch file to allocate more RAM. I've used a variation of this particular script since 1.2.4, and it has always worked fine. While updating to 1.7.2, however, I encountered a problem that I've never seen before.

Minecraft servers run straight from the directory they're in, and I (with my limited experience in batch files and java arguments) thought it was impossible to change that. However, the first time I ran the batch file, the server somehow couldn't locate the original files, and instead generated an entirely new set. This is a huge problem for several reasons, but the most important one is that I have no idea where it generated the new files.

I've checked the same directory that the server jar is in, but there is no new folder labeled "world" in there. (I always change the names of my world folders, and the original folder is still there.) I've checked the Minecraft folder and even the jre7 folder, but I can't find anything in there either. I've run the server both normally and with the batch file, and both consistently showed the same behavior.

I can't find anything pertaining to this kind of problem online - Everything I've found is about pointing the batch file to the correct jar. While I can run the server on its own, there tends to be a lot of lag unless I allocate more RAM, and so I'd really like to fix this if at all possible. Can anyone tell me what's going on?

This is the script I'm using:

@echo off
java -d64 -Xms1G -Xmx2G -jar "F:\games\Minecraft\~1.7.2MMMserver\forge-1.7.2-10.12.1.1060-universal.jar"
pause
2
Okay, I managed to get it working by running the .bat file through the command prompt instead of from the directory. While a solution is no longer necessary, I'd still like to know why this happened?DeepWaters

2 Answers

2
votes

Add a cd command which should set the working directory.

If you ran the original as admin then the working directory would be c:\windows\system32

@echo off
cd /d "F:\games\Minecraft\~1.7.2MMMserver\"
java -d64 -Xms1G -Xmx2G -jar "F:\games\Minecraft\~1.7.2MMMserver\forge-1.7.2-10.12.1.1060-universal.jar"
pause
0
votes

It works when running the batch-file from the command line interface (CLI) aka. Command Prompt