aspose file tools*
The moose likes Java in General and the fly likes Hello, but do you know how to manipulate NT Services in Java?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Hello, but do you know how to manipulate NT Services in Java??" Watch "Hello, but do you know how to manipulate NT Services in Java??" New topic
Author

Hello, but do you know how to manipulate NT Services in Java??

Kenny Smith
Greenhorn

Joined: Jan 08, 2002
Posts: 9
The question is:
If a certain NT service starts, pauses or stopped by user, is there any possible for another Java application to detect that??
Or we can say that the question boils down to how to use Java to start, pause and stop a service that registered on NT.
Any one be helpful will be greatly appreciated.


Kenny Smith
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

You can run a .bat file from your Java app to start, stop, pause, whatever. Check out the 'net' command on the DOS prompt. For example: 'net start "My Service"' I don't know about checking to see if a service is running, but there probably is a way. Anyone else? Hope this helps!

Barry
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I would guess that you need to do this with some MicroSoft tools/Code and integrate it into your Java application using some JNI.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hello, but do you know how to manipulate NT Services in Java??