I have a question that I'm struggling with and would love your help with this. Let me start with the logic of what I'm trying to do.
1. There is a windows service running. eg. Name = "Service A"
2. I want to stop the service.
3. I have an associated timeout for the service. eg. 2000
4. if the timeout occurs and the service doesnt stop in that time, I want to kill the process associated with the service.
How do I kill the process associated with the service, when I only have the name of the service. Basically, if I'm using serviceController, How do I kill the service?
I have some psuedo code here. Please advice.
ServiceController service = new ServiceController("Service A");
// need to kill the process associated with the service. But only have the service name
// with me i.e. 'Service A'