Windows

How to query, stop and delete a service in Windows

Services in the Windows OS are background processes that usually require no user interaction and is similar to a UNIX daemon process. Services provide core operating system features, such as Web serving, event logging, file serving, printing, cryptography, and error reporting.

Often times, you may need to delete a service. An example is when a program is uninstalled and does not uninstall correctly. This leaves its service in the Services list. First I will be looking at ways to stop a service.

Query a Service: Let’s assume you do not know the services name and you need to find the short service name of a service and the “services.msc” console is cannot open. follow the procedure below.

– The following command to generate a text file containing a list of services and their statuses.

SC QUERY state= all >"C:\Users\Administrator\Desktop\Service-list.txt"

– For a more concise list, execute the following command below

SC QUERY state= all | FIND "_NAME"

To Stop a Service: There are various ways to open the services console. See the following link for more information.

Via the Command Prompt (CLI): To stop the service via the CLI or Services Console. Run the command below

SC STOP shortservicename

Via Windows Services: Launch services.msc from the Run dialog box or the Windows search box. This will open up the services console.

Please pay proper attention to all the red arrow as they indicate ways in which you can stop the service.

Deleting a Service: All services are listed in the Windows Registry. If a service’s Registry key is removed, it will be deleted from the system.

Via The Command Prompt: With the name of the service you wish to delete, fire up Windows Command Prompt with elevated rights with the following commands as shown below.

Note: If the service you’re deleting has any spaces in the name, you will have to enclose the name in quotes when you type the command.

SC DELETE servicename

Via the Registry: All services are listed in the Windows Registry. If a service’s Registry key is removed, it will be deleted from the system.

For more information on Windows Registry, see the following link https://techdirectarchive.com/2020/02/08/what-is-registry-editor-and-how-to-access-the-registry-hives/
– For how to search through the registry, see https://techdirectarchive.com/2020/03/18/how-to-search-the-windows-registry/

Launched the registry key via “regedit“, then select “OK“.
– Navigate to the following location in the registry:
– HKEY_LOCAL_MACHINE
– System
– CurrentControlSet
– Services

"HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services"

Look for the service that you want delete and delete it.
– Right-click on the service as shown below and delete it.

Via Third Party Tool (SysInternal): The following third party tools can be used to delete Windows Service.

  1. AutoRuns: This method is probably the easiest from them all.
    Navigate to the services tab and perform the deletion of the specific service from there.
    – On o download and use Windows SysInternals tools locally, see https://techdirectarchive.com/2020/01/25/windows-sysinternals-tools-psexec-and-auto-logon/
    – For how to use Sysinternals Live Tools, see the following link https://techdirectarchive.com/2020/02/09/how-to-use-sysinternals-live-tools/
  2. Service Manager by Sergeg Vaulin
    Note: This is not a secure site!!! Use at your won risk http://www.devowl.net/2019/08/windows-service-create-edit-delete-servicesmsc.html

If you have found other ways to do this or found this article useful, kindly leave comment.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x