Skip to content

Instantly share code, notes, and snippets.

@timbru31

timbru31/run.bat

Last active Sep 8, 2016
Embed
What would you like to do?
Minecraft Server start script (Windows)
@echo off
title MC 1.10.2 Server DEV
:: set folder
set BINDIR=%~dp0
cd /D "%BINDIR%"
:: initial variables
set java=8
set jar=craftbukkit
:: question
echo Please choose between CraftBukkit, Spigot and PaperSpigot
echo S Spigot
echo C CraftBukkit (Standard)
echo P PaperSpigot
echo.
:: choices
choice /c SCP /t 10 /d C
if "%errorlevel%" == "1" set jar=spigot
if "%errorlevel%" == "2" set jar=craftbukkit
if "%errorlevel%" == "3" set jar=paper
:: java question
echo.
echo Please choose between Java 7 and 8
echo 7 Java 7
echo 8 Java 8 (Standard)
echo.
:: java choice
choice /c 78 /t 5 /d 8
if "%errorlevel%" == "1" set java=7
if "%errorlevel%" == "2" set java=8
:: START
::-XX:MaxPermSize=256M
cls
if %java% == 8 (
"%ProgramFiles%\Java\jre1.8.0_101\bin\java.exe" -Dcom.sun.management.jmxremote -Xincgc -Xmx4G -jar %jar%.jar
) else (
"%ProgramFiles%\Java\jre%java%\bin\java.exe" -Dcom.sun.management.jmxremote -Xincgc -Xmx4G -XX:MaxPermSize=256M -jar %jar%.jar
)
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment