Jump to content
  • 0

Windows Scheduler for restarts


bsmaff

Question

I am using Windows Task Scheduler for restarts, but when Windows trys to run the .bat file it comes up with the error.

 

Noentry '.CfgWorlds;

 

Is there something that needs to be done to get this working correctly?

The bat runs perfectly when you double click it.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

I am using Windows Task Scheduler for restarts, but when Windows trys to run the .bat file it comes up with the error.

 

Noentry '.CfgWorlds;

 

Is there something that needs to be done to get this working correctly?

The bat runs perfectly when you double click it.

 

 

 

 

 

 

 

so get on with it i am sure a few people would like to know this.

Link to comment
Share on other sites

  • 0

Here is my quick guide :D

 

How to do automated server restarts using BEC and batch files.  (This is not a guide for BEC)

 

Use this in your scheduler

 	<!-- 1 min to the 09:00 restart -->
	 
    <job id="3">
 
        <time>08:59:00</time>
 
        <delay>000000</delay>
 
        <day>1,2,3,4,5,6,7</day>
 
        <loop>0</loop>
 
        <cmd>say -1 Server is restarting!! </cmd>
 
        <cmdtype>0</cmdtype>         
 
    </job>
	
    <!-- 09:00 restart -->
 
    <job id="4">
 
        <time>09:00:00</time>
 
        <delay>000000</delay>
 
        <day>1,2,3,4,5,6,7</day>
 
        <loop>0</loop>
 
        <cmd>D:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead\Server_Restart.bat</cmd>
 
        <cmdtype>1</cmdtype>         
 

Edit the above to point to the batch file you are about to create.

 

Create a batch file and call it Server_Restart.bat   Add the following code.

@echo off
echo.
echo KILL arma2oaserver.exe
set serverkill="D:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead\Expansion\beta"
cd /d %serverkill%
taskkill /im arma2oaserver.exe
echo.
echo Kill Bec.exe
set beckill="PATHTOBECFOLDER"
cd /d %beckill%
taskkill /im bec.exe
timeout 10
echo.
echo Starting Dayz Server
:: start the server..
set dayzpath="D:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead\"
cd /d %dayzpath%
start "" "DayZ_Epoch_instance_14_Taviana.bat"
timeout 10
echo.
echo Starting Bec
:: start bec
set becpath="PATHTOBECFOLDER"
cd /d %becpath%
start "" "bec.exe" -f Config.cfg
echo.
echo Server Started 100%
cls
@exit

Make sure to change the above to match your files and paths.

 

I hope this helps.  If you have any questions you can pm me on http://www.trainwreckdayz.com

Link to comment
Share on other sites

  • 0

Actually, I ran into an issue. I've seen mention of this before, but I wanted your take on it. I hopped on my server just now. It had done 2 restarts since the last time I checked on it. All of the vehicles and buildable objects were gone. I restarted the server again (manually clicked on your restart batch file), and when i logged back in everything was back as it should be. Any idea how to remedy this?

Link to comment
Share on other sites

  • 0

Maybe just a random glitch?  I have not had that issue before. Do a little further testing and let me know if the issue continues. If it does we could take a look at the RPT file when the server comes up with "all of the vehicles and buildable objects gone".  That may let us know what type of error if any is happening.

 

Thanks!

Link to comment
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
  • Advertisement
  • Discord

×
×
  • Create New...