We are using a badly written windows service, which will hang when we are trying to Stop it from code. So we need to find which process is related to that service and kill i
You can use
tasklist /svc /fi "SERVICES eq YourServiceName"
To find the process name and id, and also if the same process hosts other services.