Advertisement
TheGamingChief

Start DayZ Server.bat

Aug 16th, 2019
14,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.00 KB | None | 0 0
  1. @echo off
  2. TITLE DayZ SA Server - Status
  3. COLOR 0A
  4.     :: DEFINE the following variables where applicable to your install
  5.     SET SteamLogin=AccountUsername AccountPassword
  6.     SET DayZBranch=223350
  7.     SET DayZServerPath="C:\Servers\DayZ"
  8.     SET SteamCMDPath="C:\Servers\SteamCMD"
  9.     SET BECPath="C:\Servers\BEC"
  10.     :: _______________________________________________________________
  11.  
  12. goto checkServer
  13. pause
  14.  
  15. :checkServer
  16. tasklist /fi "imagename eq DayZServer_x64.exe" 2>NUL | find /i /n "DayZServer_x64.exe">NUL
  17. if "%ERRORLEVEL%"=="0" goto checkBEC
  18. cls
  19. echo Server is not running, taking care of it..
  20. goto killServer
  21.  
  22. :checkBEC
  23. tasklist /fi "imagename eq BEC.exe" 2>NUL | find /i /n "BEC.exe">NUL
  24. if "%ERRORLEVEL%"=="0" goto loopServer
  25. cls
  26. echo Bec is not running, taking care of it..
  27. goto startBEC
  28.  
  29. :loopServer
  30. FOR /L %%s IN (30,-1,0) DO (
  31.     cls
  32.     echo Server is running. Checking again in %%s seconds..
  33.     timeout 1 >nul
  34. )
  35. goto checkServer
  36.  
  37. :killServer
  38. taskkill /f /im Bec.exe
  39. taskkill /f /im DayZServer_x64.exe
  40. goto updateServer
  41.  
  42. :updateServer
  43. cls
  44. echo Updating DayZ SA Server.
  45. timeout 1 >nul
  46. cls
  47. echo Updating DayZ SA Server..
  48. timeout 1 >nul
  49. cls
  50. echo Updating DayZ SA Server...
  51. cd "%SteamCMDPath%"
  52. start /wait steamcmd.exe +login %SteamLogin% +force_install_dir %DayZServerPath% +"app_update %DayZBranch%" +quit
  53. goto startServer
  54.  
  55. :startServer
  56. cls
  57. echo Starting DayZ SA Server.
  58. timeout 1 >nul
  59. cls
  60. echo Starting DayZ SA Server..
  61. timeout 1 >nul
  62. cls
  63. echo Starting DayZ SA Server...
  64. cd "%DayZServerPath%"
  65. start DayZServer_x64.exe -instanceId=1 -config=serverDZ.cfg -profiles=ServerName -port=2302 -cpuCount=8 -noFilePatching -dologs -adminlog -freezecheck
  66. FOR /l %%s IN (45,-1,0) DO (
  67.     cls
  68.     echo Initializing server, wait %%s seconds to initialize BEC..
  69.     timeout 1 >nul
  70. )
  71. goto startBEC
  72.  
  73. :startBEC
  74. cls
  75. echo Starting BEC.
  76. timeout 1 >nul
  77. cls
  78. echo Starting BEC..
  79. timeout 1 >nul
  80. cls
  81. echo Starting BEC...
  82. timeout 1 >nul
  83. cd "%BECPath%"
  84. start Bec.exe -f Config.cfg --dsc
  85. goto checkServer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement