Start.bat and cmd

I wrote a .bat for my jerky server admin helpers.
One click and all are happy.
I use it in combine with BEC for the 6h restart.
Notepad++ or notepad - save it as .bat

Copy + paste for the win if you like it.
May you will kill something else or add a new cmd order


taskkill /im arma2oaserver.exe
taskkill /im Gotcha_Antihack.exe
taskkill /im bec.exe


timeout 10 // start in 10 second the order

:: clean the server..
set cleandir="C: Edit me"
cd /d %cleandir%

timeout 5

:: Vehicle1..
set vehiclespawnpath="C:\Users\Administrator\Desktop\fix me"
cd /d %dayzpath%
start "" "_db_vehicles_clean-up.bat"

timeout 5

:: Vehicle2..
set vehiclespawnpath="C:\Users\Administrator\Desktop\fix me"
cd /d %dayzpath%
start "" "_db_spawn_vehicles.bat"

timeout 5

:: start the server..
set dayzpath="C:\Program Files (x86)\Bohemia Interactive\ArmA 2"
cd /d %dayzpath%
start "" "serverstart.bat"

timeout 65
:: start bec
set becpath="C:\Program Files (x86)\Bohemia Interactive\ArmA 2\dayz_1.panthera2\BattlEye\Bec"
cd /d %becpath%
start "" "bec.exe" -f Config.cfg

timeout 50
:: start Gotcha
set antihaxpath="C:\Users\Administrator\Desktop\Gotcha_Antihack_CommunityAlpha_082\"
cd /d %antihaxpath%
start "" "Gotcha_Antihack.exe"

cls
@exit

Simple
/Taskkill for all your server stuff /Bec/Gotcha doesnt work/Armaoa.exe and and and...

Createvehicle /One for db cleanup / Second for new spawns-respawns
Path !
Thats the tricky - you have to edit this and found your own servrestart.bat ;)
Timeout may my root is not the best, so it takes a moment before arma starts.

Simple and last step, create a folder call it Click me
Copy the db_createvehicle and paste.
done

Edit your BEC add a new job with cmd #shoutdown
Be sure you got the rigt path or it didnt works.
 
i have the same style of startserver.bat but with out gotcha, as it reconnects by itself, i also kill mysql to reinsure that vehicles respawn after theyre blown up. And i use a start command to start the programs i need so i dont have to put it in scheduler
 
Just remember NOT to taskkill mysql.
You'll get broken tables over time.

I use:
...\arma 2 operation arrowhead\server_setup\xampp\mysql\bin\mysqladmin" -u root -p<passwd> --port=3310 shutdown

also I use:

...\arma 2 operation arrowhead\server_setup\xampp\mysql\bin\MYSQLcheck -u root -p<passwd> -A --auto-repair --port=3310 --optimize

to check for errors and to tidy the database up using its own tools.
 
any other thing is how do I add a timeout for BEC bat file when I start BEC.. sometimes it will not start due to the server taking a lil bit to load.

**EDIT**
Is there away to use timeout for winxp I guess they introduced it in win vista or something
 
BEC waits until the server starts. Well it does on my server. Check you are using the latest version?

On Win XP I use:

Call timeout.bat 5
For a 5 sec wait.

Where waiting.bat consists of :

Code:
@ECHO OFF
ECHO.
ECHO Waiting %1 Seconds
@ping 127.0.0.1 -n %1% -w 1000 > nul

Place timeout.bat into a folder which is in your PATH variable.
 
BEC waits until the server starts. Well it does on my server. Check you are using the latest version?

On Win XP I use:

Call timeout.bat 5
For a 5 sec wait.

Where waiting.bat consists of :

Code:
@ECHO OFF
ECHO.
ECHO Waiting %1 Seconds
@ping 127.0.0.1 -n %1% -w 1000 > nul

Place timeout.bat into a folder which is in your PATH variable.
Yup its up todate, it does wait for server to start but some times it takes a lil longer, and while bec waits, it says check firewall settingd or port and something else then closes.

So i put the timeout bat where dayzbec.bat is, sorryim a noob when it comes to this stuff
 
I see your script doesn't start MySQL (You probably have it set as a service?)

This is mine.

Code:
T:
CD "T:\Steam\steamapps\common\arma 2 operation arrowhead"
 
 
@ECHO.
@ECHO SQL STARTED
@ECHO.
 
 
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld">NUL
if "%ERRORLEVEL%"=="1" (
  @start server_setup\silentcmd server_setup\xampp\mysql\bin\mysqld.exe --defaults-file=server_setup\xampp\mysql\bin\my.ini & echo "Please wait...Loading" & ping -n 10 127.0.0.1>nul
)
 
@start server_setup\bliss_files\db_utility.pl cleandead 3 --instance 1 --port 3310 --pass 123
@start server_setup\bliss_files\db_spawn_vehicles.pl --instance 1 --port 3310 --pass 123 --limit 99 --cleanup bounds
 
:start_server
start server_setup\silentcmd server_setup\server_chernarus_1.bat
timeout /t 6
 
:start_BEC
 
call BEC\RUN_BEC.bat
 
EXIT
 
I use this scheduler and it all works great except for when it gets to the restart alerts.. and the restart command. Any ideas why it fails there?

Code:
<?xml version="1.0"?>
<Scheduler>

<!--*** INTERNAL COMMANDS ***-->

<!--Heart Beat Check-->
<job id="0">
<time>010000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 Welcome to Peanut Butter X | 200 Active Vehicles | Admin Monitored | Daylight 24/7</cmd>
<cmdtype>0</cmdtype>
</job>

<!-- Show text ingame after 30 min with loop enabled -->
<job id="1">
<time>003000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 The Server Will Restart Every 8 Hours</cmd>
<cmdtype>0</cmdtype>
</job>

<!-- Show Text inagme after 1 hour with loop enabled -->
<job id="2">
<time>010000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 Please Report All Issues/Hackers to Clavicus or any available Server Admins</cmd>
<cmdtype>0</cmdtype>
</job>

<!--Show Text Every 30 Minutes-->
<job id="3">
<time>003000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 Join us on Team Speak 63.143.52.202:10019 | Please Check Us Out On Gametracker.com As Well!</cmd>
<cmdtype>0</cmdtype>
</job>

<!--Load Bans Every 30 Minutes-->
<job id="4">
<time>003000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>loadbans</cmd>
<cmdtype>0</cmdtype>
</job>

<!--Restart in 30 min-->
<job id="5">
<time>073000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 Server will restart in 30 minutes.</cmd>
<cmdtype>0</cmdtype>
</job>

<!--Restart in 15 minutes-->
<job id="6">
<time>074500</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 Server will restart in 15 minutes.</cmd>
<cmdtype>0</cmdtype>
</job>

<!--Restart in 1 minute-->
<job id="7">
<time>075900</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>say -1 Server will restart in 1 minute!</cmd>
<cmdtype>0</cmdtype>
</job>

<!-- Restart the server every 8 hours. -->
<job id="8">
<time>08000</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>#shutdown</cmd>
<cmdtype>0</cmdtype>
</job>

</Scheduler>
 
Back
Top