Automatic restart of EQ2World [Win32]

Tutorials on setting up a server, configuring your client, and connecting to an EQ2Emulator server.
Only moderators can start new topics here
Forum rules
Most information about EQ2Emulator and Tutorials can be found at the Project Wiki. Look there for the most current information.
Locked
bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Automatic restart of EQ2World [Win32]

Post by bolly » Tue Dec 01, 2009 3:17 pm

This is a small windows script to automatically start your server when it dies. You should add this into scheduled tasks and tailor it to your needs.

Executing this vbs script should be done using the cscript executable that comes with most versions of windows

Syntax: cscript isrunning.vbs

Code: Select all

Function IsProcessRunning( strServer, strProcess )
    Dim Process, strObject
    IsProcessRunning = False
    strObject   = "winmgmts://" & strServer
    For Each Process in GetObject( strObject ).InstancesOf( "win32_process" )
	If UCase( Process.name ) = UCase( strProcess ) Then
            IsProcessRunning = True
            Exit Function
        End If
    Next
End Function

Dim strComputer, strProcess
If( IsProcessRunning( "YOURSYSTEMNAME", "eq2world.exe" ) = True ) Then

Else

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("YOURSTARTUPSCRIPTFULLPATH")

End If
Note be sure to change: YOURSYSTEMNAME to whatever your OS is named

Change your YOURSTARTUPSCRIPTFULLPATH to whatever matches your startup script or exe ie "c:\eq2emu\startup.bat"

I run this script every minute and if the server is down it runs my startup.bat file which restarts the services.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests