1

my Q is divided to two:

1. what is a stop pending? would it stop me from changing the service dlls?

2. how can i stop a stubern service?

I am trying to close all services on a VM remotely in order to change dlls on the VMs. some services stay as stop pending. I treied wait for service through the service control manger.

sc.Stop();
sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(25));

as well I can not close a service that have dependencies

any ideas?

Tamir
  • 51
  • 6
  • The service manager can send the stop command to a service. That doesn't force the service to stop, it simply asks it to stop. It's up to the service to handle that notification and to actually stop. So `Stop Pending` simply means that the stop request was sent but that the service has not yet stopped. You can try to kill the process that the service is running it, but that's probably not safe. You'll almost certainly run into trouble if you try to stop "all" of the services. My guess is you'll either lock the machine up or get it into a place where it's not going to be entirely functional. – Pete Jul 09 '13 at 17:44
  • thank you so much! I just wanted to close a long list of services. not all. but there are few that never do close. how can I find the metching "prosses", and what is the risk? if i will wait, will somthing happen? – Tamir Jul 10 '13 at 15:02
  • I believe this will do it for you: http://stackoverflow.com/questions/565658/finding-out-windows-services-running-process-name-net-1-1 As for what will happen, if I had to guess, I'd say your machine will probably lock up when you kill the wrong service, though I don't know for sure. I know there are several services that simply aren't intended to be stopped and I wouldn't be surprised if you're denied permission to kill some of the service processes. – Pete Jul 10 '13 at 15:19

0 Answers0