Commander X800 Posted January 31, 2009 Share Posted January 31, 2009 (edited) In an effort to make things a little less bolted and more efficient, I have set a fair amount of services that belong to applications that do not start with windows to run in maul mode, so that they are not just take resources when they are not needed. The problem i am having is that after i close the respective host application(s) when i am done with it, the corresponding services do not close out as well. Instead they just linger in the processes pool. My goal is to find a way to tell a given service to terminate after its parent application closes without me manually having to terminating the process in the task manager.Edit: to fix title. Edited January 31, 2009 by Commander X800 Link to comment Share on other sites More sharing options...
Commander X800 Posted February 4, 2009 Author Share Posted February 4, 2009 Am i asking in the wrong place, is this not possible? Link to comment Share on other sites More sharing options...
CoffeeFiend Posted February 4, 2009 Share Posted February 4, 2009 (edited) Not automatically.The easy solution is to make a quick script that:starts the required service(s)starts the application (and waits in the background, hidden)when the app terminates, it stops the services againA simple vbscript (or jscript or whatever) could easily do this for you in a few lines (about a dozen or so). Have a peek at the Win32_Service WMI class (specifically the StartService and StopService methods), and the Run method of the Wscript.Shell object. Edited February 4, 2009 by CoffeeFiend Link to comment Share on other sites More sharing options...
Commander X800 Posted February 4, 2009 Author Share Posted February 4, 2009 Not automatically.The easy solution is to make a quick script that:starts the required service(s)starts the application (and waits in the background, hidden)when the app terminates, it stops the services againA simple vbscript (or jscript or whatever) could easily do this for you in a few lines (about a dozen or so). Have a peek at the Win32_Service WMI class (specifically the StartService and StopService methods), and the Run method of the Wscript.Shell object.So i could make this in Visual Studio 2008 then? Link to comment Share on other sites More sharing options...
CoffeeFiend Posted February 4, 2009 Share Posted February 4, 2009 (edited) So i could make this in Visual Studio 2008 then?Sure, you could do it in C# if you wanted, but that's quite overkill, and not so flexible: you'd have to recompile every time you make some small changes... Or you could avoid that at the expense of having to use a XML config file (i.e. app.config) which again seems a little over the top for something so simple. Plain old notepad is more than sufficient for this. Edited February 4, 2009 by CoffeeFiend Link to comment Share on other sites More sharing options...
cluberti Posted February 4, 2009 Share Posted February 4, 2009 But where's the adventure of writing an entire app just to stop and start services? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now