special quit command for custom service? (instsrv.exe, srvany.exe)


Edward Scott

Is there any way to issue a special 'quit' command for a custom service
installed with instsrv.exe and srvany.exe??

I have a batch file that launches a text-based java application. This
java application accepts input from the command prompt window, and in
order to quit one must issue it a 'q' command. This quits the java
program; the batch file subsequently ends and the command prompt window

I have installed a service using instsrv.exe and srvany.exe that runs
this batch file. It starts up without a problem; it does not quit
properly. When I use the services manager to stop my service, it
reports that the service is stopped but the application is unaffected.
Even if it managed to force the application to close, this would be far
from ideal.

I would like some means of issuing the 'q' command to the application
whenever the service is told to stop, so that it shuts down properly.
Is there a way to do this? If not, can anyone think of an effective

Wesley Vogel

net stop <service name>

net stop help
Paste the following line into Start | Run and click OK...

hh ntcmds.chm::/net_stop.htm

Type: net /? in a command prompt.

Hope this helps. Let us know.

MS-MVP Windows Shell/User


Edward Scott

no, this does not really help -- did you read my orginal message?
correct me if I am wrong, but what you have provided me with is
essentially the same as going into control panel/administrative
tools/services and stopping the service there. which, as I said in my
original message, does not stop the running application.

I am not looking for a way to stop the service from a command line. I
am looking for a way to pass a command to the application when the
service stops.

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