Windows services with java

P

Presidente

Somebody can help me to write a program in Java, which is able to find
if a Windows service has been started or not.
I mean, i need to know whether a specified service has been started or
not, if it isn't runnign i start it.
Thanks.
 
I

IchBin

Presidente said:
Somebody can help me to write a program in Java, which is able to find
if a Windows service has been started or not.
I mean, i need to know whether a specified service has been started or
not, if it isn't runnign i start it.
Thanks.
Sorry, but I do not think you can do this in java directly. You need
access to some windows API's to do this..

--


Thanks in Advance...
IchBin
__________________________________________________________________________

'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
 
T

Tim Jowers

IchBin said:
Sorry, but I do not think you can do this in java directly. You need
access to some windows API's to do this..

Lazy man's way is to issue "net start" command. Windows Lan Manager
calls still give you a full list of services running. Try it with DOS
Single Command Line Shell (start->run->cmd). You can go:
net start "Event Log"
or
net stop "Event Log"

That's really lazy! Or you can look into Service Control Manager and
write some C code. It's fairly trivial as well.

Best luck,
TimJowers
 

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
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top