Don't Back Down

Posted by Chad Everett on February 3, 2005

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.

Related Entries

Comments (48)

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

Excellent tip - thanks Stewart!

awesome!

It really worked, when nothing else seemed to help anymore. Thanks a lot.

it works! thanx

I found that using the command line "sc" worked whereas just deleting the registry entry did not.

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.

thank you very much :-)

SC worked perfectly! Thanks for the tip!

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?

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.

thanks, just what I needed...

Great stuff. sc just got added to the toolbox :)

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

Sweet, thanyou very much!

thanks for the tip! i've used it several times now to save my butt. ;)

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.

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

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

Excellent! Thanks a lot

Excellent! I couldn't find a better tool

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.

This is excellent. Simple, easy yet clearly understandable.

I did the SC and the regedit deletion. And it works great for me. Thanks a lot!

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

EXCELLENT.. something i needed badly.

If the service shows "stopping", usually it is hung up. About the only way I've found to get around it is to reboot. Sorry.

thanks for the help, Stewart. I deleted XAMPP successfully, YAY!!!

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??

Awesome - thanks!

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.

Thanks Stewart!

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.

There is also one important thing to mention - a lot of services are displayed with their display name. Go to the registry HKLM\SYSTEM\CurrentControlSet\Services look for your service and then delete it (or deal with it). You can also use "sc query" at command line.

I want to delete a service from my windows 2000 professional. Please help.

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.

thanks.....

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!

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.

AWESOME!!!

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

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

Worked real good for me...

Thanks a million, I really appreciate your help. God bless U!

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 files\networking\bin\netsrv.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.

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?

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.

thanks Stewart

the SC command saved my day :)

Sagi

Post a comment