Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 943
Thomas Jespersen Avatar asked Oct 13 '08 14:10

Thomas Jespersen


People also ask

How do you uninstall a file that does not exist?

Right click the bad file and click Add to Archives. Then in the options select to delete original file after compression. Leave other options same and proceed. Bad file will be deleted and a compressed file will be created in its place.

Can you delete a Windows service?

Click Start | Run and type regedit in the Open: line. Click OK. Scroll down the left pane, locate the service name, right click it and select Delete.


2 Answers

You have at least three options. I have presented them in order of usage preference.

Method 1 - You can use the SC tool (Sc.exe) included in the Resource Kit. (included with Windows 7/8)

Open a Command Prompt and enter

sc delete <service-name> 

Tool help snippet follows:

DESCRIPTION:         SC is a command line program used for communicating with the         NT Service Controller and services.  delete----------Deletes a service (from the registry). 

Method 2 - use delserv

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

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

Windows services are registered under the following registry key.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services 

Search for 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 the Services list)

like image 145
Jorge Ferreira Avatar answered Oct 01 '22 10:10

Jorge Ferreira


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

sc delete <service-name> 
like image 29
Dean Hill Avatar answered Oct 01 '22 09:10

Dean Hill