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 IfChange 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.