NAIL

Stop server(restart) and kill server (no restart) batch files

5 posts in this topic

This is the current "Exile Auto Start.bat" file that I am using.

@echo off
color 0a
title Exile Monitor
:Serverstart
echo Launching Server
D: 
cd "D:\ARMA3_EXILE"
echo Exile Server Monitor... Active !
start "Arma3" /min /wait arma3server.exe -mod=@Exile;@RHSAFRF;@RHSUSAF; -servermod=@ExileServer;@infiSTAR_Exile;@addons; -config=D:\ARMA3_EXILE\@ExileServer\config.cfg -port=2302 -profiles=SC -cfg=D:\ARMA3_EXILE\@ExileServer\basic.cfg -name=SC -autoinit -bepath=D:\ARMA3_EXILE\battleye
ping 127.0.0.1 -n 15 >NUL
echo Exile Server Shutdown ... Restarting!
ping 127.0.0.1 -n 5 >NUL
cls
goto Serverstart

I need to write a batch file to KILL this, one that will shut the server down and also kill this auto restart batch.

New to batch files, so any help would be greatly appreciated.  To call "restart" I can use something as simple as 

@echo off
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo Checking for running server and shutting it down if found
echo ping 127.0.0.1 -n 5 >NUL
taskkill /f /im arma3server.exe
echo.
echo.
echo.
echo Server is Stopped
echo ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
ping 127.0.0.1 -n 5 >NUL

Any one want to help me get this right, not just "working"? 

Share this post


Link to post
Share on other sites

Why would you want to kill the batch file? 

The first one will restart the server if arma3server.exe isn't running. Just add a check for "not responding" as well, then you're covered. B|

Share this post


Link to post
Share on other sites
Advertisement

I understand. I want 1 button to kill the server and the batch file if i have to do pbo uploads and other maintenance. I know i can open the window and hit x but we have 5 different game servers going and having all the controls to each server with simular shortcuts helps us not jill the wrong thing. 

Share this post


Link to post
Share on other sites

I understand. I want 1 button to kill the server and the batch file if i have to do pbo uploads and other maintenance. I know i can open the window and hit x but we have 5 different game servers going and having all the controls to each server with simular shortcuts helps us not jill the wrong thing. 

 

 

The script you use is ok to Start server, Here is one I use if you want to use it to Start/Restart your servers.

 

Save as Restart.bat

@echo off
:: Modify your folders etc!
set armapath="D:\Games\ArmA3\"
set becpath="D:\Bec\"
set serverexe=arma3server.exe


echo.
echo KILL servers
cd /d %armapath%
taskkill /im %serverexe%
echo.
echo Kill Bec.exe
cd /d %becpath%
taskkill /im bec.exe
timeout 2

echo.
echo Restarting
:: start the servers..
start D:\Games\ArmA3\arma3server.exe -config=D:\Games\ArmA3\@ExileServer\config.cfg -cfg=D:\Games\ArmA3\@ExileServer\basic.cfg -port=2302 -autoInit -loadMissionToMemory -ranking=plyrs.log -cpuCount=4 -mod=@exile;@allinarmaterrainpack;@tryk;@rhsafrf;@rhsusaf -servermod=@exileserver;@infistar_exile -profiles=sc -name=sc

echo.
echo Starting Bec
timeout 8
:: start bec
cd /d %becpath%
start "" bec.exe -f Config.cfg

echo.
echo Server Started
 
cls
@exit

 To kill a server you can use this

 

Save as Stop.bat

@echo off
:: Modify your folders etc!
set armapath="D:\Games\ArmA3\"
set serverexe=arma3server.exe


echo.
echo KILL servers
cd /d %armapath%
taskkill /im %serverexe%
echo.

echo Server Stopped
 
cls
@exit

This should work for you, Just modify your Armapatch, Etc... And if you don't use BEC then just remove the BEC bit from Restart.bat (but I highly recommend BEC as you can use it to schedule many things for your server, Control Reserved slots, kick lobby idlers, etc...)

Edited by Suranos

Share this post


Link to post
Share on other sites

these sound a bit too heavy for some simple Start / kill tasks...

i got here something working that can stop and start your server in between 1s-1min (depending on your mission)

arma3server_start.bat

D:\a3master1\arma3server.exe -serverMod=@ExileServer;@zbe_cache; -mod=@Exile;@Ryanzombies; -ip=YOURIP -port=YOURPORT -malloc=tbb4malloc_bi -profiles=config -config=config\server.cfg -cfg=config\basic.cfg -name=arma3 -autoinit -enableHT
timeout /T 5
exit

arma3server_stop.bat

taskkill /f /im arma3server.exe

 

i linked them to my the task management of microsoft (taskplanning), so my server does the arma3server_stop.bat every 4 hours and 30s after that the arma3server_start pushes in.

 

for multiple instance rename the arma3server.exe into for example arma3serverDEV.exe so you dont kill all your arma3 instances at once.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.