-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart.bat
More file actions
65 lines (40 loc) · 1.24 KB
/
Start.bat
File metadata and controls
65 lines (40 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@echo off
color 02
title 7D2DJMAD
::set task to be shutdown
::This is the server EXE to kill
set task= 7Day2Die
::Restart timer
::How many Hours for server restarts
set hours= 4
::server restart delay
set restartd= 20
::Would you like to prform a server update once a day true/false
set update= false
:: Configure to your server setup
::Set a uniqe server name please do not use spaces as this can cause issues
set svservername= 7D2DJMAD
set svPort=2305
set svServerMod=
set svMod=
::This is the server startup batch Configeration
set BatCFG="E:\Server\7D2D\7daystodieserver.exe" -quit -batchmode -nographics -configfile=serverconfig.xml -dedicated
::-------------------------------------------------------------------------------------------------------------
echo|set /p="251570" > steam_appid.txt
set SteamAppId=251570
set SteamGameId=251570
::math unit to convert hour to seconds
set /a time = %hours%*60
set /a timeoutput = %time%*60
:start
taskkill /PID %PID% /f
timeout %restartd%
cls
echo Running %task%
echo.Cycle 1
echo.
set AppCmdLine="%BatCFG%"
set ProcessCmd=wmic process call create %AppCmdLine%
for /f "tokens=3 delims=; " %%a in ('%ProcessCmd% ^| find "ProcessId"') do set PID=%%a
echo SPID=%PID%> SPID.txt
timeout %timeoutput%