|
From: Andreas W. <and...@em...> - 2004-05-08 12:41:48
|
Dan, would you please answer to the Wrapper user list in the future, so=20 other may also profit from your response to my (and other) mails. But now to your question. I would not recommend doing platform-specific stuff with Java. This=20 normally leads to more problems than you might want to solve since it=20 is most likely that things work completely different on different=20 systems. But if you are forced to do this stuff, you may either call the Windows=20= net tool (as you already mentioned) or write a JNI library that makes=20 calls into the Windows Service API (see the Wrapper's C methods=20 wrapperStartService() and wrapperStopService() in wrapper_win.c). I hope that helped. Cheers, Andreas > Andreas, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Thank you for the answer to my = problem.=A0 I did in fact=20 > have the path to my variables set as an environment variable, but they=20= > were for my desktop user not the user the service was running.=A0 I=20 > GREATLY appreciate your assistance. > > =A0 > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Would you happen to have any = knowledge on starting and=20 > stopping services programmatically through java?=A0 In my search = through=20 > the Service Wrapper documentation it appears as though there is no=20 > mechanism to do this.=A0 Is this true? > > =A0 > > IE I would like to say > > ServiceWrapper.startService(=93MyService=94); > > ServiceWrapper.stopService(=93MyService=94); > > =A0 > > And perhaps poll to see whether a service is running or not. > > =A0 > > It sounds like this could be written via a native wrapper, as I looked=20= > at the wrapper_win32.c code and it had most of this functionality in=20= > it already. > > =A0 > > Thanks, > > Dan |