|
From: Leif M. <le...@ta...> - 2010-01-01 18:28:33
|
Jim, As Javier mentioned, it is possible to execute a command from within Java. I was not sure exactly from where you wanted to stop the service. If the service is a Wrapper service, you can use "wrapper.exe -p wrapper.conf" to stop the service. You can also use "SC ..." or "NET STOP ..." from the command line. >From Java it is also possible to call WrapperManager.sendServiceControlCode(..., WrapperManager.SERVICE_CONTROL_CODE_STOP). In all cases, you will need to make sure that the calling process has permission to control other services. On Windows Vista, 2008 and 7, you will need to run from an elevated console or process. Cheers, Leif On Wed, Dec 30, 2009 at 7:35 AM, Jim Irrer <ir...@um...> wrote: > Hi - > > If I have a service running, is it possible to invoke another > program to stop it? (as opposed to using the "Services" > dialog in Windows). > > I want this so that when our group re-installs services > the old ones can be shut down automatically. It would also > be nice if anyone knows of a way to run a program to tell > Windows to start a service. > > Thanks for any info, > > - Jim |