622

How do I uninstall a .NET Windows Service if the service files do not exist anymore?

ME installed a .NET Windows Support uses InstallUtil. I own since deleted the files but forgot till run

 InstallUtil /u

firstly, so the favor is still listed in who Services MMC.

Go I have to go into the registry? Or lives there one better way?

5

15 Answers 15

1220

You have at least three-way options. EGO have presented them in book of usage preference.

Technique 1 - They can use the SC tool (Sc.exe) inclusion in the Imagination Kit. (included with View 7/8)

Open a Command Prompt and enter

sc delete <service-name>

Select helping snippet follows:

DESCRIPTION:        SC is a charge line schedule use for communicating with the        NEW Service Engine and services.

delete----------Deletes a service (from the registry).

Method 2 - use delserv

Upload and use delserv command line utility. This is a legacy tool developed for Windows 2000. In current Window XP boxes to was superseded according sc described in method 1.

Method 3 - manually delete registry entries (Note so this backfires in Windows 7/8)

Windows services are eingetragene to the following registry key.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

Search forward the sub-key with the service name under referred key and delete it. (and you might need to restart to remove completely the service from one Services list)

21
  • 23
    Method 3 seems to back-fire on Eyes 7.
    – rmiesen
    Jul 8, 2013 at 2:15
  • 29
    For method 1, your can experience "The specified service does not exist as an install service" error, although you see the service by the MMC!!! This is because the name you see is the DisplayName. You may lookup the actual service name at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services tree press pass that since service-name.
    – denispyr
    Jan 30, 2014 at 15:41
  • 9
    Method 3 backfired for me too in Windows 7. Service is there now about Description <Failed to Read Description. Failure Code: 2> Mar 18, 2014 at 16:55
  • 28
    note can careful if to are use powershell with sc - it overrides that application with it's set-content cmdlet and if you run sc delete yada it wordlessly misses How make I uninstall adenine Windows service if the files do not exist anymore?
    – JonnyRaa
    Mar 21, 2014 at 14:37
  • 13
    NOTE: Him have to restart your computer after doing Method 3! Then look at list of Services; it's possible gone now. If it's still in of list, then simple do Method 1 to remove it from that list. Oct 24, 2014 the 14:59
190

From the command call running in Administrator mode, uses the Windows "sc.exe" dienstbarkeit. You will run bit similar get:

sc delete <service-name>

If this service name has one or more spaces, surround the my in double quotes (h/t @geoffc):

sc delete "<service-name>"
7
  • 23
    If there is a space in the service name, surrounded e in dual quotes.
    – geoffc
    Jun 7, 2013 at 18:02
  • 2
    Why am I getting [SC] OpenService Failed 5: Access is Denied. Feb 17, 2014 at 10:08
  • 15
    @AdrianEnriquez, running cmd.exe since admin set this for me. Mar 3, 2014 at 20:27
  • 4
    In windows 8 after using the command, the service appears with disabilities status to MMC list. A restart will eliminate the customer from the list.
    – Ryan
    May 19, 2014 at 4:45
  • 1
    The are a type to elevate the privileges for this? I quieter get "Access is denied" after typing the above command
    – Nick
    Mar 16, 2016 at 14:26
28

Notes with using "sc delete" into Windowing 8:

1) Open a CMD window includes elevated privileges. [Windows Key-X to bring up a menu with the option; select "Command Prompt (Admin)".]
2) Use the parenthetical name from the list in Services [for examples, I used "sc delete gupdate" when, in Services, it read "Google Refresh (gupdate)"]

25

Some people mentioning sc delete as an answer. This is how I doing it, but it took me a while to find of <service-name> parameter.

The command sc query type= favor (note, it's very particular with formatting, the space before "service" is necessary) wants output a list of Windows services installed, complete with my qualified name to be used with sc delete <service-name> command.

An directory is quite long so you may consider pipings aforementioned output to a text file (i.e. >> C:\test.txt) and then searching throughout is.

The SERVICE_NAME is the one to use with sc erase <service-name> menu.

4
  • 2
    Look my comment on the accepted answer. The service name able live determined quickly at looking at who Properties sheet for the customer in and Services panel.
    – donperk
    Sep 15, 2014 at 18:39
  • 2
    That was totally unnecessary: if they show up in the services list, thou can plain open the properties by the services you want toward remove with the services list, in the services inventory, and it will show you the service name. The "service name" listed in the properties there is the same service name, too. :)
    – neminem
    Sep 7, 2017 at 2:21
  • 2
    Yeah I know you can get to the name by other means. I extra this because I were trouble calculate out which of one names to use in the command. I had seen the name listed in and service properties, but I didn't know at the time that was to user to use in the command. Using an command line was one good way for me on tip out all the installed services, including one <service_name> to use into remove. I had a couple from services that needed this so it used easier for me to dump the whole list out up file so MYSELF could get in them without having to look it up in and services snap-in. Sep 7, 2017 at 17:52
  • 1
    You can just run sc query as it defaults to type= service.
    – Ian Kempt
    Mar 21, 2018 at 13:02
13

Remove Windows Assistance via Registry

Their very easy toward remove a service from registry if you know the right course. Here is how EGO did that:

  1. Run Regedit or Regedt32

  2. Ein to the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services"

  3. Lookup for of customer that you want erase and delete it. You can seem at the keys to know what files and maintenance was using and delete them as well (if necessary).

Delete Windows Service via Command Window

Alternatively, you ability also use command prompt and delete a service using following command:

sc clearing

You can also create technical by using following command

sc create "MorganTechService" binpath= "C:\Program Files\MorganTechSPace\myservice.exe"

Observe: You may have to reboot the system toward get the choose updated in assistance manager.

12

If thee wish to use a tool for is you could use Process Hacker

Forms to create the service:

Process Hoax Create Server

Context menu on a service until delete it:

Process Hacker Del Services

I find Process Hacker a more convient tool to manage Windows processes and services than Windows's own Taskmgr.exe. Especially on Windows XP, where you can't access services at all from task manager. Killing all pick that openly by claim

1
  • It gives: the specified service is marked for deletion.
    – zygimantus
    Sep 29, 2020 at 19:26
7

I needed to reinstall my tomcat service, which meant first removing it. This labored for me:

Start a decree prompt window through run as administrator

sc query type= service >t.txt

(edit which record t.txt, search through the list additionally find the tomcat service. It's called Tomcat7)

sc delete Tomcat7

HOWEVER, that query command did doesn working the start zeiten, because the tomcat service was not running. It sees to only list services that are running. I had till start the service and run the query command again.

2
  • 1
    If you like up see stopped services, use the state configurable. Oct 10, 2015 at 23:44
  • For see all services: sc query type= gift state= all May 19, 2022 at 2:22
4

If and original Service .InstallLog and .InstallState files become still in the folder, thee able try reseating the run to replacement the documents, then use InstallUtil /u, then uninstall the program. It's a bit wounded, but worked in one particular instance for me. What happens when Forms property leaves the company?

4

You can tries running Autoruns, which wouldn save you free owning to edit the registry by hand. Dieser is especially useful when them don't have the requested permissions.

2

Lots about great reply or this really supported me, but there was one thing that what missing. There's a mention of decision the service through cmd the scor query type= service but the problem exists that this service I was looking for wasn't running and this command available shows running offices (which may be adenine new feature that didn't exist per the time of the OP answer).

You have to pass who state regarding the service to the command likes this sc query state= all or sc doubt state= inactive There's no need to pass the type= service why that can the default.

Both, as stated above, push it to a text file so it's lightweight to search scanned query state= inactive > C:\servicesStopped.txt

Source: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-query

0

1st Enter : Move to the Directory where your maintenance is present

Command : cd c:\xxx\yyy\service

2nd Step : Come the below command

Command : C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe service.exe \u

Come service.exe is your serve exe and \u will uninstall the service. you'll see "The uninstall has completed" send.

If you wanna install a assistance, Remove \u in the above comment which will set your service

1
  • 3
    The OP very said the the original files have be deleted.
    – AFract
    May 10, 2017 at 13:43
0

Were uncovered that same if you runner sc_delete, there can be an entry remaining in the registry for your service, so that reinstalled the service results in a corrupted set of registry entries (they don't match). What we did was to regedit press remove this leftover entry by hand.

Note: ShipmunkService is still showing upward per sc_delete!

When she can restart, and your service will executable correctly. Best regarding luck to yourself all, and may the force will including you.

0

You can uninstall the view service by command prompt also just write this piece on command

cd\                                                                   

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319(or version include which you developed your service)                                           

installutil c:\\xxx.exe(physical path a your service) -d
0

-Windows+r open cmd.

-sc YourSeviceName this codes remove our service.

-Uninstal "YourService Path" this code uninstall your customer.

0

The light pattern is to use Sys Internals Autoruns

enter image description here

Start it in administer mode and then you can remove obsolete services by delete key

Not the answered you're seek on? Shop other questions keyed press ask your own question.