Jump to content
Evox

Server Auto Restart (Batch File)

Recommended Posts

 Server Auto Restart (Batch File)

Author Evox

Northern Star Roleplay

For Help Please Feel Free To Join My Teamspeak

Ts3.NorthernStarRP.com

Hey Everyone, This Is A Simple Server Restart Batch File/Tool That Allows You To Have Automatic Restarts Every X-Amount Of Hours.

I Do Ask For The Community To Respect That I Am The Original Author.

I Would Like To Apologize As This Is My First Post/Tutorial

P.S. Yes Their Are Some Colours To Help Those In Need.

Download For The Batch File Is At The Bottom.

Batch File Code Below.

 

 

//////////////////////////////////////////////////////////////////////////
//         AUTHOR 
EVOX - NORTHERN STAR ROLEPLAY           //
//   FOR HELP PLEASE FEEL FREE TO JOIN MY TEAMSPEAK   //
//                           AND ASK FOR 
EVOX                            //
//        TEAMSPEAK - 
TS3.NORTHERNSTARRP.COM             //
///////////////////////////////////////////////////////////////////////

title Server Auto restarts
@echo off
C:\Windows\System32\mode con cols=50 lines=6 >nul
set /a var=0
COLOR 0B
set EXE=Hello.exe     //Note you must change the name of your server "arma3server_x64.exe" to something like "Hello.exe".


:Start
title Arma 3 Server ( Restarts %var% )
echo -------------------------------------------------
echo ------------- Server Restarts ( %var% ) -------------
echo ---------------- Server Running -----------------
echo ---------------- Created By Evox ----------------
echo -------------------------------------------------
set /a var+=1
start "" "EXE directory and parameters here"     //Example: c:\services\arma3\hello.exe -config=c:\services\arma3\config\server.cfg -port=2302  -cpucount=4 -mod= [email protected]_server;@extdb2 -profiles=sc -name=sc
timeout /t 7200 >nul     //Note this is where you will set the amount of time until restart. Time is in seconds ( 2 Hours = 7200 Seconds, 3 Hours = 10800 Seconds, 4 Hours = 14400 Seconds, 6 Hours = 21600 Seconds )
cls
goto Stop


:Stop
title Arma 3 Server ( Restarts %var% )
echo -------------------------------------------------
echo ------------- Server Restarts ( %var% ) -------------
echo --------------- Server Restarting ---------------
echo ---------------- Created By Evox ----------------
echo -------------------------------------------------
taskkill /f /im %EXE% >nul
timeout /t 5 >nul
cls
goto message


:Message
title Arma 3 Server ( Restarts %var% )
echo -------------------------------------------------
echo ------------- Server Restarts ( %var% ) -------------
echo --------- Server Restarted Successfully ---------
echo ---------------- Created By Evox ----------------
echo -------------------------------------------------
timeout /t 5 >nul
cls
goto Start

 

 

Download Batch File Here --> Server Auto Restart.bat

Edited by Evox
Small Edit
  • Thanks 1

Share this post


Link to post
Share on other sites

I personally don't think it's worth using a batch like this for restarts. I would of thought you'd be much better off using Windows task scheduler or arma remote admin. 

 

 

What's With The Capital Letters At The Start Of Every Word?

Share this post


Link to post
Share on other sites
20 minutes ago, Wackbatt said:

I personally don't think it's worth using a batch like this for restarts. I would of thought you'd be much better off using Windows task scheduler or arma remote admin. 

 

 

What's With The Capital Letters At The Start Of Every Word?

 

I don't agree nor do I disagree, this is due to the fact that it's all based on preference and knowledge. Not everyone knows how to set up the task scheduler, and for the arma remote admin I wanted to make something so that you do not need to use an external site. Again this is just a simple batch file that I had made for those who would like to have something different other than the task scheduler and external site. I also have yet to see a batch file that does automatic restarts for servers and I thought it would be a nice tool to have as it is very simple to set up and use. Personally, I've used task scheduler and arma remote admin and I've also used this batch file and they all work nicely. Again just something that's different that I wanted to share with the community.

 

I honestly don't know I just felt like having caps on every word.  

Edited by Evox

Share this post


Link to post
Share on other sites

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

×