Can you delete a service?

Posted on 2004-11-30
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

    try something like this

    InstallUtil /u yourservice.exe

    LVL 25

    Expert Comment

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

    Accepted Solution

    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.
    LVL 6

    Expert Comment

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

    for help:
    regsvcs /?

    Author Comment

    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

    like I said before

    InstallUtil /u yourservice.exe

    this will remove it from the list

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now