Can you delete a service?

Posted on 2004-11-30
Medium Priority
Last Modified: 2010-04-23
Is it possible to delete a windows service with .NET.  If so an example would be great.  I've looked at ServiceProcess.ServiceInstaller.uninstall but have not figured out how to use yet.
Question by:mwertz
LVL 25

Expert Comment

ID: 12713898
try something like this

InstallUtil /u yourservice.exe

LVL 25

Expert Comment

ID: 12713908
the installutil is part of the .net framework and can be found in
c:\windows\microsoft.net\framework\v1.x.xxxx where x.xxxx is the version of the framework you use
LVL 41

Accepted Solution

graye earned 2000 total points
ID: 12719194
I'm not exactly sure I understand... but if you're wanting to disable a service, that's pretty strait forward.    So, I'm guessing you're trying to make it "go away" from the list of services that the PC is aware of.

If so, then a simple method would be to just delete the registry key (starting at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services) that is responsible for listing that service.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 12722775
Also try RegSvcs from the .NET command prompt:
regsvcs /u AssemblyName

for help:
regsvcs /?

Author Comment

ID: 12727381
Yes, that's correct, I'm trying to make it go away from the list of services.   I already tried to delete from \CurrenControlSet\Services but it is still listed.  
LVL 25

Expert Comment

ID: 12727422
like I said before

InstallUtil /u yourservice.exe

this will remove it from the list

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question