Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set LOGTIMESTAMP=
- for /f "tokens=* skip=19" %%F in ('dir 7DaysToDieServer_Data\output_log*.txt /o-d /tc /b') do del 7DaysToDieServer_Data\%%F
- WMIC.EXE Alias /? >NUL 2>&1 || GOTO s_start
- FOR /F "skip=1 tokens=1-6" %%G IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
- IF "%%~L"=="" goto s_done
- Set _yyyy=%%L
- Set _mm=00%%J
- Set _dd=00%%G
- Set _hour=00%%H
- Set _minute=00%%I
- Set _second=00%%K
- )
- :s_done
- Set _mm=%_mm:~-2%
- Set _dd=%_dd:~-2%
- Set _hour=%_hour:~-2%
- Set _minute=%_minute:~-2%
- Set _second=%_second:~-2%
- Set LOGTIMESTAMP=__%_yyyy%-%_mm%-%_dd%__%_hour%-%_minute%-%_second%
- :s_start
- echo|set /p="251570" > steam_appid.txt
- tasklist /FI "IMAGENAME eq 7daystodieserver.exe" 2>NUL | find /I /N "7daystodieserver.exe">NUL
- if "%ERRORLEVEL%"=="0" goto SKIPPED
- start 7daystodieserver -logfile 7DaysToDieServer_Data\output_log%LOGTIMESTAMP%.txt -quit -batchmode -nographics -configfile=serverconfig.xml -nounet -sdxconfig="C:\steamcmd\Starvation Mod\7DaysToDieServer_Data\Managed\settings.ini" -dedicated
- echo Starting server ...
- :SKIPPED
- ECHO The script will connect to the server as it comes online.
- set /p ask=Do you want to connect using MS Telnet or Putty? (t/p)
- cls
- ECHO Waiting for the server to come online...
- :START
- netstat -na | find "5555">NUL
- if "%ERRORLEVEL%"=="1" goto START
- ECHO The server is online!.
- if %ask%==t (goto Telnet) else goto Putty
- :Telnet
- pkgmgr /iu:"TelnetClient"
- telnet 127.0.0.1 5555
- goto END
- :Putty
- start putty telnet://127.0.0.1:5555/
- :END
Advertisement
Add Comment
Please, Sign In to add comment