[Request] Batch Restarter

Experienced Elementalist
Joined
Dec 7, 2006
Messages
250
Reaction score
2
I know that there exists such batch code, to check if for ex:

gameserver.exe is up, and restarts if its down.

tryed googling, all i could find is: *codes to restart computers/shuwdown computers*


i know the code is about 2 lines, cant remember:p
 
Last edited by a moderator:
Re: Batch Restarter

It wouldn't be 2 lines, if it existed.

Its not possible without:
a. Forcing the servers to just restart, without the checks, or
b. An external application to utilise the FindWindow/Ex or other API in an attempt to find the window handle of the application you are seeking.
 
Re: Batch Restarter

actually, If you wanted to create one to be manually run when the server is known to be offline, you can set something up for admins to doit. It would first check for the running processes of AIserver.exe, ebenezer.exe, aujard.exe, versionmanager.exe. If they are all still up, /serverdown 3 in ebenezer. delay 5 mins. Allow ebenezer to save any data it can. Then end the processes through the batch file after the delay. Then start ai server.exe delay 1, ebenezer delay 2, aujard, login server. it's very simple.
 
Re: Batch Restarter

basicly its possible to do but when i tried to make such bat\exe file i had problams with the maps for some reason i had errors from ai server and ebenzer :S.
tho i made shut down if u want i can post.
its go to ebenezer do /down wait 20 sec than kill the 4 proccess its better cuz ai server allways need to shut down manually from task mgr
 
Re: Batch Restarter

actually, If you wanted to create one to be manually run when the server is known to be offline, you can set something up for admins to doit. It would first check for the running processes of AIserver.exe, ebenezer.exe, aujard.exe, versionmanager.exe. If they are all still up, /serverdown 3 in ebenezer. delay 5 mins. Allow ebenezer to save any data it can. Then end the processes through the batch file after the delay. Then start ai server.exe delay 1, ebenezer delay 2, aujard, login server. it's very simple.
An auto-restarter though is typically an application that detects if the server is offline. Should it be offline/crashed, it will automatically restart the server back up.

As for the delay, meh. Really, that's.. very hacky.

PS: As for the problems you're encountering, its because its not started from the right working directory. Personally, I'd use the CreateProcess API to launch it, but that's just me...
 
To launch the server i use a LOADER.BAT with:
Code:
cd "C:\KOServer\Login Server"
start "melosilla" "C:\KOServer\Login Server\mystver.exe"
@ping -n 22 -w 1000 127.0.0.1 > nul
cd "C:\KOServer\AIServer"
start "melosilla" "C:\KOServer\AIServer\AiServer_MY_20050531.exe"
@ping -n 22 -w 1000 127.0.0.1 > nul
cd "C:\KOServer\Ebenezer"
start "melosilla" "C:\KOServer\Ebenezer\1298.exe"
@ping -n 22 -w 1000 127.0.0.1 > nul
cd "C:\KOServer\Aujard"
start "melosilla" "C:\KOServer\Aujard\Fix Auj.exe"

melosilla= title of the windows change it wathever you want
ping is used to make a 20 seconds delay
Server is on c:\KOServer, change all to your current location

This is NOT a solution for RESTART, you have tu manually kill all your applications from process list.

Smr
 
u can use task kill :P
lol this is how i shut down my server with autoit
WinActivate("GameServer Ver - 20041111")
ControlSend("GameServer Ver - 20041111", "", "","/down")
ControlSend("GameServer Ver - 20041111", "", "","{ENTER}")
sleep(50000)
Run("TASKKILL /F /IM VersionManager.exe")
Run("TASKKILL /F /IM AiServer.exe")
Run("TASKKILL /F /IM Ebeneze2r.exe")
Run("TASKKILL /F /IM Aujard.exe")

thx for gerydeft for all his help with autoit he explaind me how to use it
 
Back
Top