30

I would like to do this because I have a half installed service because of installation failure which is just there, non-functioning.

How can I delete the Windows service using the command line?

random
  • 15,201

3 Answers3

39

NOTE: You'll likely need an elevated command prompt (right click => "Run as Administrator") to execute this command

the sc command is what you want, specifically sc delete

C:\Users\Jeff>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]
Jeff Atwood
  • 24,402
14

We need to stop the service before deleting it from the Registry:

sc stop [Service name]  
sc delete [service name]  

Run Command prompt as an administrator and execute above commands.

Enclose the service name in double quotes if it contains spaces.

CSharp
  • 241
-1

Simply put quotation marks between any service name that contain spaces C:\WINDOWS\system32>sc delete "Your Ugly Service"