Not satisfied by the Answer? Still have doubts?
Ask Question

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

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

I installed a .NET Windows Service using InstallUtil. I have since deleted the files but forgot to run
InstallUtil /u


first. So the service is still listed in the Services MMC.

Do I have to go into the registry? Or is there a better way?
installation windows-services windows
by

3 Answers

akshay1995
From the command prompt, use the Windows "sc.exe" utility. You will run something like this:

sc delete <service-name>
pankajshivnani123
Remove Windows Service via Registry

Its very easy to remove a service from registry if you know the right path. Here is how I did that:

Run Regedit or Regedt32

Go to the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services"

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

Delete Windows Service via Command Window

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

sc delete

You can also create service by using following command

sc create "MorganTechService" binpath= "C:Program FilesMorganTechSPacemyservice.exe"

Note: You may have to reboot the system to get the list updated in service manager.
kshitijrana14
You can uninstall your windows service by command prompt also just write this piece of command

cd                                                                   

cd C:WindowsMicrosoft.NETFrameworkv4.0.30319(or version in which you developed your service)

installutil c:xxx.exe(physical path of your service) -d

Login / Signup to Answer the Question.

  • Be descriptive with your answer, and try to avoid copy-pasting external links, instead guide the user who has asked the question, where can they find the detailed answer.
  • You cannot share any URL in answer.
  • To make a text bold, surround the text with single asterisk, for example *bold text*
  • To format a text like code, surround the text within double asterisk, for example **code**
  • To add a multiline piece of code, surround the whole code within triple asterisk, for example *** multiline code ***
  • Please verify before submitting the answer.