2022-04-23 03:01:57 +00:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set GRASSCUTTER_JAR=%1
|
|
|
|
set GRASSCUTTER_JAR=%GRASSCUTTER_JAR:"=%
|
|
|
|
|
2022-04-23 07:32:54 +00:00
|
|
|
:: Get folder the jar is in
|
|
|
|
set "X=%GRASSCUTTER_JAR%"
|
|
|
|
:l
|
|
|
|
if "%X:~-1%"=="\" goto al
|
|
|
|
set "X=%X:~0,-1%"
|
|
|
|
goto l
|
|
|
|
:al
|
|
|
|
set "X=%X:~0,-1%"
|
|
|
|
set "GRASSCUTTER_ROOT=%X%"
|
|
|
|
|
2022-04-23 03:01:57 +00:00
|
|
|
:: Ensure admin
|
|
|
|
>nul 2>&1 reg query "HKU\S-1-5-19" || (
|
|
|
|
set params = %*:"="""%
|
|
|
|
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 "%1"", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Starting local Grasscutter server...
|
|
|
|
|
2022-04-23 06:45:43 +00:00
|
|
|
:: Change dir to server directory
|
2022-04-23 07:32:54 +00:00
|
|
|
cd /d "%GRASSCUTTER_ROOT%"
|
2022-04-23 06:45:43 +00:00
|
|
|
|
2022-04-23 03:01:57 +00:00
|
|
|
start /b java -jar %GRASSCUTTER_JAR%
|