Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I launch Minecraft.exe which invokes Javaw.exe. I wish for Javaw.exe to be running in High priority because Minecraft lags if not.

I tried invoking Minecraft.exe with a high priority by doing this:

Start "Minecraft" /high "C:\Users\Barrie\Documents\Program Files\Minecraft\Minecraft.exe"

This would work if it wasn't for Minecraft loading Javaw.exe. I would love a simple solution - perhaps a command I can put into the batch script - which will change the priority of Javaw.exe after it loads.

Edit: I'd like to thank everyone for their response to my issue. I fixed this by executing Minecraft.exe with a batch script then calling an AHK script to change the priority of Javaw.exe.

share|improve this question
    
Running a CPU-intensive program in High priority can hang your system. –  kinokijuf Dec 25 '11 at 8:31
    
Luckily Minecraft isn't CPU intensive it just lags a lot if javaw.exe doesn't have high priority –  Arch Angel Dec 26 '11 at 17:31
    
The start command should work. If minecraft.exe is started with high priority and spawns javaw.exe, it should inherit the priority of the parent process. Perhaps minecraft.exe is specifically setting the priority of javaw.exe to normal. In that case, you will need to either set it manually or use a third-party tool as mentioned below (or use some batch-file trickery). –  Synetech Jun 7 '12 at 21:21
add comment

6 Answers

up vote 2 down vote accepted

What I would do:

Use process explorer to get the full parameters passed to javaw to launch the game and then use them with start.

For safe guard, you can put the command in a batch file and use some command line utility to raise the priority of explorer.exe to the same level, so you can use the Windows key to escape from the game.

I don't play Minecraft, but if the above didn't work, it is probably due to some preparation work done by Minecraft.exe being omitted. In this case you may need to use some stub program to wrap either javaw.exe or the Java class it is calling.

share|improve this answer
add comment
@echo off
start "Minecraft" /high "C:\Program Files\Java\jre6\bin\javaw.exe" -Xmx1024M -Xms1024M -jar MinecraftLauncher.jar
@echo off
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
"%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx1024m -Xms1024m -jar MinecraftLauncher.jar
PAUSE

And if that didnt work

@echo off
start "Minecraft" /high "C:\Program Files\Java\jre6\bin\javaw.exe" -Xmx1024M -Xms1024M -jar MinecraftLauncher.jar
@echo off
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
"%ProgramFiles%\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar MinecraftLauncher.jar
PAUSE

This one works the best for me. After I adapted your code to merge with this, its best for me because if my Minecraft decides to crash, I can quit before it corrupts, so if you're gonna use one, these are best.

share|improve this answer
add comment

Try this:

START "minecraft" /high /wait "C:\Program Files\Java\jre7\bin\javaw.exe" -Xms1024m -Xmx2048m -cp "%APPDATA%\.minecraft\bin\minecraft.jar;%APPDATA%\.minecraft\bin\jinput.jar;%APPDATA%\.minecraft\bin\lwjgl.jar;%APPDATA%\.minecraft\bin\lwjgl_util.jar" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft <username> <password>
share|improve this answer
add comment

You can do that in Task Manager, right clicking on the javaw.exe process you have a Set Priority option.

Process Explorer from Sysinternals also has that.

share|improve this answer
    
This guy wants to do this automatically. –  kinokijuf Dec 26 '11 at 17:38
add comment

I changed the priority of it using a little batch script.

@echo off
start "Minecraft" /high "C:\Program Files\Java\jre7\bin\javaw.exe" -Xmx1024M -Xms1024M -jar "%appdata%\.minecraft\minecraft.exe"
share|improve this answer
add comment

Try Process Tamer. May not be what you exactly want but it will help. Use its configuration to set javaw.exe to high priority.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.