.net - How to force uninstallation of windows service

ID : 20319

viewed : 43

Tags : .netwindows-services.net

Top 5 Answer for .net - How to force uninstallation of windows service

vote vote

96

One thing that has caught me out in the past is that if you have the services viewer running then that prevents the services from being fully deleted, so close that beforehand

vote vote

85

You don't have to restart your machine. Start cmd or PowerShell in elevated mode.

sc.exe queryex <SERVICE_NAME> 

Then you'll get some info. A PID number will show.

taskkill /pid <SERVICE_PID> /f 

Where /f is to force stop.

Now you can install or launch your service.

vote vote

70

well, you can use SC.EXE to delete any windows Service forcefully if un-install doesnt removes by any chance.

sc delete <Service_Name> 

Read more on "MS Techno Blogging" Deleting Services Forcefully from Services MMC

vote vote

61

I know this isn't going to help, but it might help someone in the future.

I've just had the same problem, closing and re-opening the services manager removed both the entry from the registry and completed the uninstall of the service.

Previous to that, refreshing the services manager hadn't helped.

vote vote

57

sc delete sericeName 

Just make sure the service is stopped before doing this. I have seen this work most times. There are times where I have seen windows get stuck on something and it insists on a reboot.

Top 3 video Explaining .net - How to force uninstallation of windows service

Related QUESTION?