Restart Script

Shako95

New Member
Hello, i tried to create a restart script with the .bat script but when i start this script for a restart the database doesen't load...what is wrong here? ;(

Code:
CD C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead
@echo off
taskkill /IM dayzserver_1.exe /F &
cls
CD C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead
"Expansion\beta\dayzserver_1.exe" -port=2302 "-config=dayz_1.chernarus\config_8b322d1e.cfg" "-cfg=dayz_1.chernarus\basic.cfg" "-profiles=dayz_1.chernarus" -name=Reality "-mod=@day
z;@reality_1.chernarus" "-world=chernarus" -noPause -noSound -cpuCount=4 -exThreads=4 -maxMem=4096
exit
 
Hello, i tried to create a restart script with the .bat script but when i start this script for a restart the database doesen't load...what is wrong here? ;(

Code:
CD C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead
@echo off
taskkill /IM dayzserver_1.exe /F &
cls
CD C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead
"Expansion\beta\dayzserver_1.exe" -port=2302 "-config=dayz_1.chernarus\config_8b322d1e.cfg" "-cfg=dayz_1.chernarus\basic.cfg" "-profiles=dayz_1.chernarus" -name=Reality "-mod=@day
z;@reality_1.chernarus" "-world=chernarus" -noPause -noSound -cpuCount=4 -exThreads=4 -maxMem=4096
exit
You need to start the database separately. In my restart scripts I have at the beginning a check if the database is running. If it isn't running it runs another script that starts it up.
Code:
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld">NUL
if "%ERRORLEVEL%"=="0" goto next
if "%ERRORLEVEL%"=="1" @start mysql_start.bat & echo "Please wait...Loading" & timeout /t 15 /nobreak >nul & goto next
 
I use:

Code:
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld">NUL
if "%ERRORLEVEL%"=="1" (
  @start <full path to where your copy of msql.exe lives>\mysql\bin\mysqld.exe --defaults-file=<path to where your my ini lives>\my.ini & echo "Please wait...Loading" & ping -n 10 127.0.0.1>nul
)

This code starts the Mysqld.exe program if it not running.
In my case this is on the same PC as I run the server.
 
Back
Top