Unable to get server to auto restart anyone able to help been trying for days

djnateb

New Member
Hey,

Ive been trying to get my server to auto restart for a few days now with no avail.

I've tried many restart.bats all of which start a new server but doesn't kill the original

my current restart.bat (i will post below) brings a box up as it's taking place however i get unable to kill process armaoaserver_1.exe access denied i have tried running the bat as admin but it still doesn't work im assuming this is what was happening with all the other batch files but with this one i can see the error.

any heres my current batch file.

Go easy on me im newish to all this stuff


Source code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
:: Server Start and Restart batch for DayZ Server Controlcenter written by Crosire:: This is just a sample edit of Crosires file for current version Control Center, made by GermanMG. You NEED to adjust the settings first!:: Do not use with versions older than 5.9.1.0
@echo off
:: Settings:
REM Turned all the relative paths into absolute paths to resolve issues people had with "file not found" errorsREM Main directory, very important!!! ""s are inserted further down the page, no need to add them hereset ARMApath=D:\Steam\SteamApps\common\arma 2 operation arrowheadREM Set the instance number here.set instance=1REM build the location of BEC executable for this instance, start at the \@dayz_config\... folderset BECpath=\@dayzcc_config\%instance%\BECREM Set the port of the server here.set port=2302REM Set the server modlist hereset mod=@dayz;@dayzccREM 3 = Use built-in php script (recommended)REM 2 = Generate vehicles using PHP (old) REM 1 = Generate vehicles using PERL (old)REM 0 = Do not generate vehiclesset vehicles=3REM Path to an external batch file to execute. Set it to 0 if you don't use one.set externalbat=0
REM Your MySQL connection details - you need this to generate vehicles directly into the DBset dbhost=127.0.0.1set dbport=3306set dbuser=dayzset dbpass=dayzset dbname=dayz_chernarus
set vehiclelimit=60set cleanup=allset worldid=1

REM WorldIDs:REM 1=chernarus (@dayz)REM 2=lingor (@dayzlingor)REM 3=utes (@dayz)REM 4=takistan (@dayztakistan)REM 5=panthera2 (@dayzpanthera)REM 6=allujah (@dayzfallujah)REM 7=zargabad (@dayzzargabad)REM 8=namalsk (@dayz;@dayz_namalsk)REM 9=mbg_celle2 (@mbg_celle;@dayz_celle;@dayz_conflicts)REM 10=tavi (@taviana)

:: Do not edit from here on >>>> LOL

timeout 5:initializecls:: see if our settings are correctecho ARMA main directory is: "%ARMApath%"echo ARMA BEC directory is: "%ARMApath%%BECpath%"echo.cd /d "%ARMApath%"echo Switched to ArmA 2 main directory:echo %CD%echo.echo Killing current running server ...taskkill /f /IM arma2oaserver_%instance%.exeecho.if not "%externalbat%" == "0" (start %externalbat%)echo.if "%vehicles%" == "1" goto generate_old_perlif "%vehicles%" == "2" goto generate_old_phpif "%vehicles%" == "3" goto generate_new_phpgoto start

:generate_new_phptimeout 5echo Generating vehicles with CCs script...:: use BEC to call batch script to call php script to tamper with databases. someone shoot me please.\@dayzcc\php\php.exe -r "require_once('%cd%\@dayzcc\htdocs\dayz\modules\lib\class.vehicles.php'); $gen = new vehicle_generator(new mysqli('%dbhost%:%dbport%', '%dbuser%', '%dbpass%', '%dbname%')); $gen->setDatabaseName('%dbname%'); $gen->setInstanceID(%instance%); $gen->setWorldID(%worldid%); $gen->execute();"::settings are at the top of the fileecho.echo.goto start
:generate_old_phptimeout 5echo Generating vehicles old school with php...:: use BEC to call batch script to call perl script to tamper with databases. someone shoot me please.\@dayzcc\php\php.exe vehicles.php --limit %vehiclelimit% --cleanup %cleanup% --instance %instance% --host %dbhost% --port %dbport% --user %dbuser% --pass %dbpass% --database %dbname% ::settings are at the top of the fileecho.echo.goto start
:generate_old_perltimeout 5echo Generating vehicles old school..."@dayzcc\perl\bin\perl.exe" -w @dayzcc\utils\vehicles.pl --limit %vehiclelimit% --cleanup %cleanup% --host %dbhost% --port %dbport% --user %dbuser% --password %dbpass% --database %dbname% ::settings are at the top of the fileecho.echo.
:starttimeout 5echo Starting server again ...@start @dayzcc_config\%instance%\arma2oaserver_%instance%.exe -beta=Expansion\beta;Expansion\beta\Expansion -mod=%mod% -name=Server -config=@dayzcc_config\%instance%\config.cfg -cfg=@dayzcc_config\%instance%\basic.cfg -profiles=@dayzcc_config\%instance%\ -port=%port% -cpuCount=2 -maxMem=2048 -exThreads=1 -noPause -noSoundecho.
:start_bectimeout 15echo starting BEC again...cd /d "%ARMApath%%BECpath%"echo Switched to instance %instance%'s BEC directory:echo %CD%start "" "bec.exe" -f Config.cfgecho.echo restart procedure completedexit
:: Do not edit until here <<<<
:: Crosire, 2012. Visit "http://dayzcc.tk"!


I've posted this on a few other forums and as of yet mo1 seems to be able to help :(
 
well this is what i use

Code:
@echo off
echo KILL arma2oaserver.exe
taskkill /im arma2oaserver.exe
echo.
ping 127.0.0.1 -n 5 >NUL
echo KILL Battleye Extended Control - Bec
taskkill /f /im Bec.exe
cd "C:\Users\Administrator\Desktop\DayZ Servers\Server 1\"
perl spawn_vehicle_cleanup.pl --host 127.0.0.1 --user dayz --pass databasepwhere --name server1 --port 3306 --world chernarus --cleanup all
ping 127.0.0.1 -n 5 >NUL
echo Starting server...
start .\Expansion\beta\arma2oaserver.exe -maxMem=6144 -cpuCount=2 -exThreads=1 -noCB -nosplash -noPause -noSound -mod=C:\Program Files (x86)\Steam\steamapps\common\Arma 2;EXPANSION;ca -mod=Expansion\beta;Expansion\beta\Expansion -mod=@dayz;@reality_1.chernarus -name=Reality -config=dayz_1.chernarus\config_a90e0f4c.cfg -cfg=dayz_1.chernarus\basic.cfg -profiles=dayz_1.chernarus
ping 127.0.0.1 -n 2 >NUL
echo START BEC
cd "C:\Users\Administrator\Desktop\DayZ Servers\Server 1\Bec\"
start "" "bec.exe" -f config.cfg
exit
 
well this is what i use

Code:
@echo off
echo KILL arma2oaserver.exe
taskkill /im arma2oaserver.exe
echo.
ping 127.0.0.1 -n 5 >NUL
echo KILL Battleye Extended Control - Bec
taskkill /f /im Bec.exe
cd "C:\Users\Administrator\Desktop\DayZ Servers\Server 1\"
perl spawn_vehicle_cleanup.pl --host 127.0.0.1 --user dayz --pass databasepwhere --name server1 --port 3306 --world chernarus --cleanup all
ping 127.0.0.1 -n 5 >NUL
echo Starting server...
start .\Expansion\beta\arma2oaserver.exe -maxMem=6144 -cpuCount=2 -exThreads=1 -noCB -nosplash -noPause -noSound -mod=C:\Program Files (x86)\Steam\steamapps\common\Arma 2;EXPANSION;ca -mod=Expansion\beta;Expansion\beta\Expansion -mod=@dayz;@reality_1.chernarus -name=Reality -config=dayz_1.chernarus\config_a90e0f4c.cfg -cfg=dayz_1.chernarus\basic.cfg -profiles=dayz_1.chernarus
ping 127.0.0.1 -n 2 >NUL
echo START BEC
cd "C:\Users\Administrator\Desktop\DayZ Servers\Server 1\Bec\"
start "" "bec.exe" -f config.cfg
exit

I've fixed this now by using bec's #shutdown command to kill the server then running the restart.bat to restart it working fine now
 
Back
Top