Monday, June 15, 2009

How to delete a windows service?


I had to work with a windows service few days ago. An application creates a windows service which does some work in the background. During the development, we ended up creating multiple services with different names. For those of you who don't know where to look for these, just open up the command prompt from your windows box and type services.msc




In my case, I was managing my task by stopping/disabling the old services and starting/enabling the one that is in use. But the list grew and the management task is getting ugly. Then I came to know about a simple command to get rid of these useless entries/services.


From command prompt, invoke the service control manager with SC command and with corresponding parameters. In my case, I had to give 'SC delete [service name]'


To see various parameters available hit SC without any parameter. Hope this helps you when dealing with services.


No comments: