spectralforce

starv bat

Mar 5th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. @echo off
  2. set LOGTIMESTAMP=
  3. for /f "tokens=* skip=19" %%F in ('dir 7DaysToDieServer_Data\output_log*.txt /o-d /tc /b') do del 7DaysToDieServer_Data\%%F
  4. WMIC.EXE Alias /? >NUL 2>&1 || GOTO s_start
  5. FOR /F "skip=1 tokens=1-6" %%G IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
  6. IF "%%~L"=="" goto s_done
  7. Set _yyyy=%%L
  8. Set _mm=00%%J
  9. Set _dd=00%%G
  10. Set _hour=00%%H
  11. Set _minute=00%%I
  12. Set _second=00%%K
  13. )
  14. :s_done
  15. Set _mm=%_mm:~-2%
  16. Set _dd=%_dd:~-2%
  17. Set _hour=%_hour:~-2%
  18. Set _minute=%_minute:~-2%
  19. Set _second=%_second:~-2%
  20. Set LOGTIMESTAMP=__%_yyyy%-%_mm%-%_dd%__%_hour%-%_minute%-%_second%
  21. :s_start
  22. echo|set /p="251570" > steam_appid.txt
  23.  
  24.  
  25. tasklist /FI "IMAGENAME eq 7daystodieserver.exe" 2>NUL | find /I /N "7daystodieserver.exe">NUL
  26. if "%ERRORLEVEL%"=="0" goto SKIPPED
  27. 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
  28.  
  29. echo Starting server ...
  30. :SKIPPED
  31. ECHO The script will connect to the server as it comes online.
  32. set /p ask=Do you want to connect using MS Telnet or Putty? (t/p)
  33. cls
  34. ECHO Waiting for the server to come online...
  35. :START
  36. netstat -na | find "5555">NUL
  37. if "%ERRORLEVEL%"=="1" goto START
  38. ECHO The server is online!.
  39. if %ask%==t (goto Telnet) else goto Putty
  40. :Telnet
  41. pkgmgr /iu:"TelnetClient"
  42. telnet 127.0.0.1 5555
  43. goto END
  44. :Putty
  45. start putty telnet://127.0.0.1:5555/
  46. :END
Advertisement
Add Comment
Please, Sign In to add comment