Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem These are the user variables. set them as needed
- Set Jarname=spigot.jar
- rem Minimum RAM to allocate to the server (MAX 1024M)
- Set MinRam=512M
- rem Maximum RAM to allocate on 64 Bit machines (No MAX)
- Set MaxRam=2G
- rem Maximum RAM to allocate on 32 Bit machines or 64 Bit machines running 32 bit Java (MAX 2048M)
- Set MaxRam32=512M
- rem ---------------------------------------------------------------------------------------------
- rem Java version variables.
- SET JavaVersion=8
- SET JavaUpdate=101
- rem Java install location variables.
- rem These should only be changed if java is not installed in the default location
- SET Java=C:\Program Files\Java
- SET JavaX86=C:\Program Files (x86)\Java
- rem ---------------------------------------------------------------------------------------------
- rem System Variables, leave these alone or the script may not run correctly
- SET PATH=C:\Windows\System32
- SET BINDIR=%~dp0
- CD /D "%BINDIR%"
- color 7
- :start
- cls
- if exist .\%Jarname% (
- goto detectArch
- ) else (
- goto noJar
- )
- :detectArch
- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
- goto 64Bit
- ) else (
- goto 32Bit
- )
- :64Bit
- if exist "%Java%\jre1.%JavaVersion%.0_%JavaUpdate%" (
- color A
- Echo.
- Echo 64 Bit mode
- ping 1.1.1.1 -w 1 >NUL
- cls
- color 7
- "%Java%\jre1.%JavaVersion%.0_%JavaUpdate%\bin\java.exe" -Xms%MinRam% -Xmx%MaxRam% -jar %jarname%
- goto end
- ) else if exist "%JavaX86%\jre1.%JavaVersion%.0_%JavaUpdate%" (
- color C
- Echo.
- Echo Warning! Running in 32 bit mode!
- Echo Forge based servers may not work properly if at all in this mode.
- Echo Install Java 64 Bit for best performance
- ping 2.2.2.2 -w 1 >NUL
- cls
- color 7
- "%JavaX86%\jre1.%JavaVersion%.0_%JavaUpdate%\bin\java.exe" -Xms%MinRam% -Xmx%MaxRam32% -jar %jarname%
- goto end
- ) else (
- cls
- Echo.
- Echo Java couldn't be found in either:
- Echo "%Java%\jre1.%JavaVersion%.0_%JavaUpdate%"
- Echo OR
- Echo "%JavaX86%\jre1.%JavaVersion%.0_%JavaUpdate%"
- Echo.
- Echo Make sure the Java variables on lines 16 and 17 to match
- Echo the version and update numbers you have installed
- Echo If you still have Java 7, you should update to Java 8
- Pause
- Exit
- )
- :32Bit
- if exist "%Java%\jre1.%JavaVersion%.0_%JavaUpdate%" (
- color C
- Echo.
- Echo 32 bit mode
- ping 2.2.2.2 -w 1 >NUL
- cls
- color 7
- "%Java%\jre1.%JavaVersion%.0_%JavaUpdate%\bin\java.exe" -Xms%MinRam% -Xmx%MaxRam32% -jar %jarname%
- goto end
- ) else (
- cls
- Echo.
- Echo Java couldn't be found in:
- Echo "%Java%\jre1.%JavaVersion%.0_%JavaUpdate%"
- Echo.
- Echo Make sure the Java variables on lines 16 and 17 to match
- Echo the version and update numbers you have installed
- Echo If you still have Java 7, you should update to Java 8
- Pause
- Exit
- )
- :noJar
- cls
- Echo The JAR file '%Jarname%' could not be found
- Echo Please replace '%Jarname%' on line 4 of this file with the name of the jar you have.
- pause
- exit
- :end
- cls
- color E
- Echo.
- Echo STOPPED! CLOSE NOW TO STOP FULLY!
- Echo.
- Echo Script Written By Jamiephonc. PM on FTB or Spigot forums for support.
- ping 1.1.1.1 -w 5 >NUL
- ping 2.2.2.2 -w 5 >NUL
- goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement