Manually Remove a Windows Service

I needed to remove some services the other day and could not recall the name of the tool that allows you to easily add and remove services from Windows. I think it’s srvany.exe, but I have no idea how recently it has been updated, and I couldn’t find it anyway.

So I needed to remove a service and I couldn’t figure it out. Until I stumbled across this piece of sage advice.

Namely, find your way to this registry location:

 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services

Locate the service you want to get rid of, and delete its key. Done. You may want to stop the service first, since you won’t be able to once it’s gone (and you may not even be able to remove the service until it’s stopped). You might also want to check any filenames used in the key for the service, so that you can also remove the files associated with the service.

52 Replies to “Manually Remove a Windows Service”

  1. You can also use the command line tool “sc” to delete a service (as well as a whole bunch of other things, like set it to manual/auto, stop/start it, etc).

    C:>sc delete
    DESCRIPTION:
            Deletes a service entry from the registry.
            If the service is running, or another process has an
            open handle to the service, the service is simply marked
            for deletion.
    USAGE:
            sc  delete [service name]

    Cheers,
    Stewart

  2. The command line tool ‘sc’ is better. The registry deletion just deletes it visually in some listings, it doesn’t really delete the service itself.

  3. hmmm…SC worked pretty good when I tried to delete a couple of services but when I tried to delete my corrupt MySQL daemon it threw an error:

    “[SC] DeleteService FAILED 1072:”

    Any ideas?

  4. Excellent, thanks a lot :D.

    James: First disable MySQL service, try to desinstall all MySQL packages, delete all files and folders (for MySQL, mysql admin etc) and then use sc command line tool. It works for me.

  5. The error 1072 (mentioned by James in comment 10) is probably caused by the service being referenced by some other process so it can’t be deleted. However, 1072 is “Marked for Deletion” according to my microsoft documentation, and the next time you reboot the service will be deleted.

  6. Just tried sc delete, and liked that better than just tearing it out of the registry.

    Just be sure you use “sc delete [serviceName]” not the service description.

    The services list displays the description, rather than the actual service name, so open the service you want to remove, and find out the actual name.

  7. Hi,
    I have my windows service registry entry removed, but my service still exists there, in a status of ‘stopping’. Any ideas of how to get this removed from my server.
    I tried all different means of removing it from the system, but in vain.

    Thank you,
    Suman S. Chitemella

  8. I tried this as:

    SC delete [DameWare Mini Remote Control] and it did not work. I am trying to remove the dameware service with a batch file.

    Here is the error.
    OpenService Failed: 1060

    It says the service is not installed or doesn’t exist. But it does. I can Stop the service with NET Stop so I believe I am entering the correct service name.

    Any advice??

  9. Hi, I am running with W2000 Pro SP4, I do not have access to the sc command. -:(

    Can I download an exe from somewhere or any equivalent?

    Thanks.

  10. Great, everything works.

    I would like to mention that command line sc delete [service name] is “better” way to delete (or to deal) with service, because SC undramatically updates service database and registry, while just deleting service from registry needs one restart before everything sits in place.

  11. There is also one important thing to mention – a lot of services are displayed with their display name. Go to the registry HKLMSYSTEMCurrentControlSetServices look for your service and then delete it (or deal with it). You can also use “sc query” at command line.

  12. The delete a service tool for Win 2K is called delsvr.exe. It is available from here.

    It was very difficult to locate on the Microsoft web site – took me a at least an hour searching to track it down!

    For the complete Win 2K resource kit, see here.

  13. sc worked great on 2003 server, it was a production environment and just deleting the key from the registry wasn’t enough because server restart was required. SC fixed it all, great post!

  14. I can end a process that is hung ‘stopping’ without rebooting by using [End Process] in the Task Manager. Shouldn’t there be an equivalent command or scripting element?
    I need a script to run periodically to check the service, end it if it’s hung, then restart it. Any ideas?
    Seems like the sc query, sc delete, sc create, and sc configure might all offer something, if we could just get the hung service stopped.

  15. Guys,

    I found it easier to use /UnRegServer option to remove from the Services List and from the Registry.

    A Service name abc.exe can be unregistered using the following command.
    abc.exe /UnRegServer

    Hope this will be helpfull to all of you!

    Thanks
    NKR

  16. Hi
    I am able to delete my service from Service list and registry but it still shows in Add/Remove programs under control panel. Even I have restarted my machine also.
    Please help me out.
    Thanks
    Karuna

  17. Hi,

    I’m trying to get rid of a service on some Windows Server 2003 boxes I administer. The service in question is “NetBIOS TCP/IP Server”, and the reason for wanting it gone is that the executable (c:program filesnetworkingbinnetsrv.exe /server) simply doesn’t exist. I don’t know where this service comes from or why, but the lack of an actual executable causes the Computer Browser, Workstation and Server services to fail, thus somewhat crippling the servers.

    Would it be safe to delete the service? Would this remove the imposed dependancy from the Workstation and Server services? If not, where else could I look for a remedy to this solution? The servers are all production servers and thus I’m reluctant to “just delete it and see what happens”. Any pointers are welcomed.

    Thanks.

  18. Any idea how to get a service back once you delete it? I’m thinking of deleting the windows time service, because its creating all kinds of problems with my time settings. But can I get it back later?

  19. Hi Norman –

    Assuming that you haven’t already deleted it, I would just export the key from regedit prior to doing so. Then in the worse-case scenario, you can just import it back.

  20. Be aware of the fact that sometimes the description of a service as is it given in the Windowws Services list is slightly different from the name of the service as it is written in the Windows registry.
    When trying to delete a service with sc or oamksvc, using the description form the services list, sometimes a message is returned that the service is not recognized as an installed service. In this case you must enter the registry and search for officially registered name.

Leave a Reply

Your email address will not be published. Required fields are marked *