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.


Posted

in

Comments

52 responses to “Manually Remove a Windows Service”

  1. Linh Avatar
    Linh

    Excellent! Thanks a lot

  2. mj Avatar
    mj

    put MYSQL in ALL CAPS and try again… that worked for me

  3. David Avatar
    David

    Actually works for .NET services that will not remove with installUtil. Thanks!

  4. dick Avatar
    dick

    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.

  5. MJB Avatar
    MJB

    thanks for the tip! i’ve used it several times now to save my butt. ๐Ÿ˜‰

  6. Nicholas Byfleet Avatar
    Nicholas Byfleet

    Sweet, thanyou very much!

  7. george r Avatar

    This works great on XP, but not on 2000. Please let me know what the equivalent cmd is!!
    Thanks, Geo

  8. Michael Avatar
    Michael

    Great stuff. sc just got added to the toolbox ๐Ÿ™‚

  9. Wiebe Tijsma Avatar

    thanks, just what I needed…

  10. ripzy Avatar
    ripzy

    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.