Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I delete a service in Windows?

I have a couple old services that I want to completely uninstall. How can I do this?

like image 309
sgwill Avatar asked Sep 16 '08 19:09

sgwill


People also ask

How do I delete a service in Windows 10?

Hold down the Windows Key, then press “R” to bring up the Run dialog. Type “SC DELETE servicename“, then press “Enter“.


1 Answers

Use the SC command, like this (you need to be on a command prompt to execute the commands in this post):

SC STOP shortservicename SC DELETE shortservicename 

Note: You need to run the command prompt as an administrator, not just logged in as the administrator, but also with administrative rights. If you get errors above about not having the necessary access rights to stop and/or delete the service, run the command prompt as an administrator. You can do this by searching for the command prompt on your start menu and then right-clicking and selecting "Run as administrator". Note to PowerShell users: sc is aliased to set-content. So sc delete service will actually create a file called delete with the content service. To do this in Powershell, use sc.exe delete service instead


If you need to find the short service name of a service, use the following command to generate a text file containing a list of services and their statuses:

SC QUERY state= all >"C:\Service List.txt" 

For a more concise list, execute this command:

SC QUERY state= all | FIND "_NAME" 

The short service name will be listed just above the display name, like this:

SERVICE_NAME: MyService DISPLAY_NAME: My Special Service 

And thus to delete that service:

SC STOP MyService SC DELETE MyService 
like image 107
Lasse V. Karlsen Avatar answered Oct 03 '22 13:10

Lasse V. Karlsen