View Single Post
  #2  
Old 08-30-2009, 07:15 PM
leslamarch
Discordant
 
Join Date: Sep 2006
Location: Green Bay, WI
Posts: 436
Default

Quote:
Originally Posted by Speedz View Post
One of my biggest annoyances I have that I am researching is that when the GUI is closed, all but the Shell stay running and hidden (have to be closed in task manager if you want to restart a server again).
This should work for you?
Code:
    foreach (Process p in Process.GetProcessesByName("world")) {
        p.Kill();
        p.WaitForExit();
    }
    foreach (Process p in Process.GetProcessesByName("eqlaunch")) {
        p.Kill();
        p.WaitForExit();
    }
    foreach (Process p in Process.GetProcessesByName("zone")) {
        p.Kill();
        p.WaitForExit();
    }
    foreach (Process p in Process.GetProcessesByName("Login")) {
        p.Kill();
        p.WaitForExit();
    }
    System.Environment.Exit(0);
}
Reply With Quote