Geeks With Blogs
Shahed's blog Sharing my thoughts and work

 

Recently, I was trying to delete a windows service. Normally it should not be necessary to manually delete a service. Uninstalling an application should remove its associated service (if any).

However, I installed some beta products and a service created by one of the applications was not removed automatically. Its very easy to remove a service from registry if you know the right path. Here is how I did that:

1. Run Regedit or Regedt32

2. Find the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services"

3. Look for the service there and delete it. You can look at the keys to know what files the service was using and delete them as well (if necessary).

alternatively, you can also use command prompt and delete a service using following command:

sc delete < SERVICE name>

or to create, simply type
sc create <SERVICE name>

Update: 
If you have space in the file path you need to use quotation marks ("). For example: 
sc create "MySQL" binpath= "C:\Archivos de programa\MySQL\MySQL Server 5.1\bin\mysqld.exe"

Thanks to Maya.

NOTE: You may have to reboot the system to get the list updated in service manager.

Posted on Friday, October 13, 2006 4:54 PM | Back to top


Comments on this post: How to delete a windows service

# re: How to delete a windows service
Requesting Gravatar...
Or even:

sc delete <service name>

;o)
Left by Carl on Oct 16, 2006 5:38 PM

# re: How to delete a windows service
Requesting Gravatar...
Hi Carl,

Thanks, fixed the typo. :)
Left by Shahed on Oct 20, 2006 11:12 PM

# re: How to restore a deleted a windows service
Requesting Gravatar...
How can we restore a service that is deleted from cmd prompt withthe cmd sc delete <servicename> ????????
Left by ravi on Oct 31, 2008 12:31 PM

# re: How to delete a windows service
Requesting Gravatar...
Hi Ravi,

You can create a service in following way:

sc create "<service name>" binpath= "<file path>"

please note that you may need to put a single space right after the binpath=
Left by shahed on Oct 31, 2008 4:56 PM

# re: How to delete a windows service
Requesting Gravatar...
Great No I can delete the ORACLE services .
thanks a lot
Left by yusuf on Jul 09, 2009 12:00 AM

# re: How to delete a windows service
Requesting Gravatar...
In my experience, this is the wrong format...correct format is:
sc delete "service name" (with quotes and no brackets,etc)
Left by James on Aug 04, 2009 10:30 AM

# re: How to delete a windows service
Requesting Gravatar...
Very useful...i resolved my problem because of this
Left by Anil on Aug 19, 2009 4:55 AM

# re: How to delete a windows service
Requesting Gravatar...
Thanks a lot - I'd deleted the registry keys but didn't know you had to reboot before it would disappear from the services snap in, the joys of Windows eh?
Left by Russ on Oct 13, 2009 5:53 AM

# re: How to delete a windows service
Requesting Gravatar...
actually, just 'refresh' services manager, don't need to reboot.
Left by Jim on Dec 01, 2009 4:07 PM

# re: How to delete a windows service
Requesting Gravatar...
In fact, you can delete windows services without the brackets nor the quotes. The use of brackets <> is a standar used to denote a parameter in the syntax of commands.
Left by Erick Acosta on Dec 17, 2009 12:30 PM

# re: How to delete a windows service
Requesting Gravatar...
This is the correct sintaxis
sc create "MySQL" binpath= "C:\Archivos de program
a\MySQL\MySQL Server 5.1\bin\mysqld.exe"


[SC] CreateService SUCCESS

:-D
Left by Maya on Feb 04, 2010 7:11 PM

# re: How to delete a windows service
Requesting Gravatar...
Hi Maya,

yes, you are right. If you have space in the file path you need to use quotation marks (").

Thanks,
Shahed
Left by Shahed on Feb 04, 2010 7:35 PM

# re: How to delete a windows service
Requesting Gravatar...
Thanks for your help, its currently worked, hi to all indians
Left by Erhun on Apr 12, 2010 1:58 PM

# re: How to delete a windows service
Requesting Gravatar...
I would like to say Hi to all the indians too
Left by fred on May 04, 2010 5:20 PM

# re: How to delete a windows service
Requesting Gravatar...
Hmmm ... the reboot is really needed in some cases?! The deleted service doesn't go away without?!
Left by mihai on Jun 17, 2010 2:37 AM

# re: How to delete a windows service
Requesting Gravatar...
That's great thanks. Helped me get over an old McAfee service that wouldn't behave.
Left by Mike Smith on Jul 07, 2010 8:29 PM

# re: How to delete a windows service
Requesting Gravatar...
Thanks :)
Left by Mahen on Aug 15, 2010 11:59 PM

# re: How to delete a windows service
Requesting Gravatar...
It works, thanks
Left by Sarika on Sep 20, 2010 12:57 AM

# re: How to delete a windows service
Requesting Gravatar...
service deleted from system using regedit ( delete the "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services" )

But it link not remove from system

Plz help
Left by pintu on Oct 06, 2010 4:08 AM

# re: How to delete a windows service
Requesting Gravatar...
did you mean, its not removing from the "administrative tools->services" list?

Sometimes, you may need to restart the system. If its still there, there "sc delete <SERVICE name>"
Left by Shahed on Oct 06, 2010 8:53 AM

# re: How to delete a windows service
Requesting Gravatar...
Humm I wonder if you can network Unreal Dreamcast over a or a direct dial up null connection?
Left by ugg boot sale on Dec 12, 2010 7:49 PM

# re: How to delete a windows service
Requesting Gravatar...
Thanks a lot !! It s really helpful..
Left by Gowsalya on Dec 31, 2010 3:46 AM

# re: How to delete a windows service
Requesting Gravatar...
Thanks, I got this sorted evetually with your solution and another solution on techieshelp.

http://www.techieshelp.com/remove-a-windows-service-via-registry/
Left by allen white on Feb 09, 2011 1:30 PM

# re: How to delete a windows service
Requesting Gravatar...
Good work. The command prompt solution dint work for me but Regedit solution did!!!
Thanks! :-)
Left by Isaiah on Jun 03, 2011 1:24 AM

# re: How to delete a windows service
Requesting Gravatar...
I have a similar problem to what you had. I tried to uninstall it the way you did and I thought I managed to delete it, but I found it again later in services :/.

I tried your second way but CMD says that it does not exist :(. I restarted my computer after the first delete btw, and I can't find it in the registry editor anymore. Any help would be greatly appreciated :).
Left by Randomer on Oct 29, 2011 2:55 PM

# re: How to delete a windows service
Requesting Gravatar...
Thanks!
In my situation deleting the regs didn't work, but the command solved the problem.
Left by Samy on Feb 16, 2012 3:03 AM

# re: How to delete a windows service
Requesting Gravatar...
how to delete service programmitcally while creating new version of project plz tell me if any one knows! fast!
Left by Uttam on Apr 12, 2012 3:51 AM

# re: How to delete a windows service
Requesting Gravatar...
thanks a lot!!
Left by vimal on May 08, 2012 6:25 AM

# re: How to delete a windows service
Requesting Gravatar...
hi Gurus,

Thanks for the command -- sc delete <Service name>

using this cmd i have removed the oracle service.

thanks for your help.

regards
sathya
Left by sathya on May 24, 2012 1:42 PM

# re: How to delete a windows service
Requesting Gravatar...
Just wanted to add one clarification. The service name may differ between what is shown in the windows services to what is held in the registry - when typing the command you should use the service name listed in the registry (regedit.exe) under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services

In my instance the name here did not contain spaces but the one listed in the services window did - it would only accept the true name held in the registry - but thanks, this fixed my issue!
Left by Nath on Oct 22, 2012 5:22 PM

# re: How to delete a windows service
Requesting Gravatar...
If you delete the registry entry and notice it's still there in the service list, you need to do this;
sc query state= all
This will list all services, including the one you just deleted.
Find the service name then;
sc delete nameofservice

Keep in mind it's not the title of the service but the registry key name of the service.
Left by TheHinac on Feb 06, 2013 8:42 AM

# re: How to delete a windows service
Requesting Gravatar...
"Access is denied"

What do I do?
Left by Paulo on Jun 05, 2013 9:29 PM

# re: How to delete a windows service
Requesting Gravatar...
Paulo do run as administrator ;)
Left by Neal on Jun 24, 2013 7:06 AM

# re: How to delete a windows service
Requesting Gravatar...
Awesome article!!!
Left by Sarbjit on Sep 11, 2013 3:15 AM

# re: How to delete a windows service
Requesting Gravatar...
Hi,

Issue resolved thanks for the help. I have deleted from the registry level and after reboot its gone from services.msc.

Thanks
Venkat
Left by Venkat on Oct 02, 2013 6:33 AM

# re: How to delete a windows service
Requesting Gravatar...
http://www.ghacks.net/2011/03/12/how-to-remove-services-in-windows/

use autoruns
Left by Jamesey on Nov 06, 2013 9:05 AM

# re: How to delete a windows service
Requesting Gravatar...
EVEN AFTER UNINSTALLING THE ORACLEXE IS PRESENTED,HOW TO DELETE A ORACLEXE SERVICE FROM SERVICES IN WINDOWS7
Left by REETHESH REDDY on Nov 20, 2013 2:16 PM

# re: How to delete a windows service
Requesting Gravatar...
I accidentally deleted a service when I meant to stop it so I could restart it, how can I restore the service to normal?
Left by Secret on Dec 23, 2013 4:58 AM

# really helpful
Requesting Gravatar...
Thanks for the help! Really useful
Left by Justin on Dec 27, 2013 3:41 AM

# re: How to delete a windows service
Requesting Gravatar...
ok i have had a windows professional tell me the services that are stopped on my compute is due to malicious software and then proceeded to try and charge me i need to know exaclty what to do to get rid of the non running services and replace them without fucking my computer up
Left by justin on Dec 30, 2013 3:32 PM

# re: How to delete a windows service
Requesting Gravatar...
Hi Justin,

I wouldn't do that. Rather than removing all non-running services, I would go through the windows service list and remove specific ones if they look suspicious.

There are many services that are installed part of different tools that might not be running due to current configuration settings. (i.e. some SQL Server services)
Left by Shahed on Jan 01, 2014 10:47 AM

# That did it, thanks
Requesting Gravatar...
Thanks, deleting the registry key and then restarting seems to have done the trick. I found that refreshing the svc manager was still showing the service.

Left by Sandy on Mar 12, 2014 1:40 PM

# re: How to delete a windows service
Requesting Gravatar...
Anybody knows the way to write batch for delete services using wildcard?
for instance I have couple records:
"service1 - t12345"
"service1 - t23456"
"service1 - t34567"
"service1 - t45678" etc.
something like that:
sc delete "service1 -" + *

Left by garg on Mar 21, 2014 9:43 AM

Your comment:
 (will show your gravatar)


Copyright © Shahedul Huq Khandkar | Powered by: GeeksWithBlogs.net | Join free