Thursday, September 4, 2008

Developing on Windows: Reinstalling disabled services

As part of our project we have automated installing a service as part of our deployment script. However services go into a zombie state of 'disabled' if you have given the service a wrong password and tried to start it up.
Once a service gets disabled you cannot start, stop or uninstall it from the services console (services. msc). Rebooting the machine gets rid of the disabled service, and we can reinstall the service, however rebooting isn't an option for production machines.

We finally realized that we could reinstall the service over a disabled service as long as the "service console" (Service.msc) was closed.

It is annoying how having the GUI for service manager open, somehow stops me from reinstalling a service.

2 comments:

Julie said...

Have you tried the sc command? It even takes password. In detail, please refer to http://msdn.microsoft.com/en-us/library/ms810435.aspx

Shaun Jayaraj said...

Thanks a lot Julie.
sc is a really helpful tool