I am using the Apache Commons Daemon (prunsrv.exe) as a wrapper to run an .exe as a Windows Service. However, I am not sure what the proper way of killing only this instance of the .exe is when the service is manually stopped. I could not find any documentation for the .exe mode of the Commons Daemon, so I am using the following arguments to prunsrv.exe when I install the service: //IS//[service name] [installation arguments] --StopImage "C:\Windows\System32\taskkill.exe" ++StopParams /IM;[.exe name];/T;/F
My concern is that this will kill all instances of the .exe, not just the one running as a service. Is there a way I can kill only the instance generated by the service?