starting service from java

B

Bruintje Beer

Hi,

Is it possible to start a xp service from java ? For example start a ftp
service ?

John
 
T

Tor Iver Wilhelmsen

Bruintje Beer said:
Is it possible to start a xp service from java ? For example start a ftp
service ?

Runtime.getRuntime().exec(new String[] { "cmd.exe", "/C", "net",
"start", "servicename" });
 
A

Alan Krueger

Bruintje said:
Is it possible to start a xp service from java ? For example start a ftp
service ?

Using Jawin[1] or a custom JNI class, call the OpenSCManager[2] and
related functions exported by ADVAPI32.DLL. Once you have the Service
Control Manager, you can OpenService and ControlService.

(This is probably an opportunity to add something to Jawin if it's not
already there.)


[1] http://jawinproject.sourceforge.net/
[2] http://msdn.microsoft.com/library/en-us/dllproc/base/openscmanager.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top