Skip to content

Instantly share code, notes, and snippets.

@myrkvi
Created January 26, 2013 13:40
Show Gist options
  • Save myrkvi/4642445 to your computer and use it in GitHub Desktop.
Save myrkvi/4642445 to your computer and use it in GitHub Desktop.
An offline launcher for Minecraft written in Batch.
@echo off
IF "%1" == "-jar" goto file_not_exists ::If the argument -jar is added, you can set a new minecraft.jar.
IF EXIST "%APPDATA%\jar" goto file_exists
IF NOT EXIST "%APPDATA%\jar" goto file_not_exists
:file_exists ::If a previous config is found, it will just ask for the username.
set /p JAR=<"%APPDATA%\jar"
set /p uname="Username: "
java -Xincgc -Xmx1024m -cp "%APPDATA%\.minecraft\bin\%JAR%;%APPDATA%\.minecraft\bin\lwjgl.jar;%APPDATA%\.minecraft\bin\lwjgl_util.jar;%APPDATA%\.minecraft\bin\jinput.jar" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft "%uname%"
goto eof
:file_not_exists ::If no previous config was found, create a new one.
set /p setJAR="Minecraft jar (.minecraft\bin\): "
echo %setJAR%
echo "%setJAR%" > "%APPDATA%\jar"
set /p uname="Username: "
java -Xincgc -Xmx1024m -cp "%APPDATA%\.minecraft\bin\%setJAR%;%APPDATA%\.minecraft\bin\lwjgl.jar;%APPDATA%\.minecraft\bin\lwjgl_util.jar;%APPDATA%\.minecraft\bin\jinput.jar" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft "%uname%"
goto eof
:eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment