This tutorial provides step-by-step instructions on how to delete Windows service from command line or registry. These instructions work on both Windows 10 and Windows 11 and allow you to remove orphaned or unwanted services.
Overview of Windows services
Windows services are special programs that run in the background on your computer. They start with your system and provide functions that need to run continuously and don’t need your ongoing interaction. For example, antivirus runs a service in the background that continually monitors your files for viruses, as it needs to perform this task from the moment the computer starts and doesn’t need your input (if action needs to be taken, it can communicate with an associated desktop application that asks you to review its findings, install an update, etc.).
Services are different from standard applications in that they don’t have a direct interface and do not show up in the system tray or start bar, effectively hiding them from you during day-to-day use. Most services are part of Windows itself, providing sound, networking, and audio functionality, while others are added by third-party applications like third-party antivirus, firewalls, or file sharing and networking platforms.
You may want to delete a service on Windows because it is left over from an uninstalled application, or it is wasting resources. Uninstalling services must be done correctly to prevent your system from malfunctioning.
Precautions before deleting a Windows service
Before you perform any maintenance on your Windows PC, you should take a full backup of your system. If you’re deleting a service from the Windows registry, you should also take a registry backup.
You should also make sure you understand exactly which service you are deleting and its purpose to avoid accidentally removing the wrong service (and potentially something your system relies on to operate). You should at the very least search for the service name online before you delete it to make sure it isn’t something you need.
Deleting Windows Services via the Command Line
To delete a Windows service using the command line, follow these instructions:
- Open the Services Manager console by right-clicking on the Start menu, clicking Run, and entering services.msc.
- Find the service you want to delete in the list, and right-click on it. If Stop is not grayed out, click it to stop the service.
- Make a note of the service name exactly as it is spelled in the Name column.
- Right-click on the Start menu again, and click on Terminal (Admin), or Command Prompt (Admin) if you’re on Windows 10.
- Enter the command sc delete SERVICENAME, replacing SERVICENAME with the exact name you recorded earlier.
This will delete the service from the configured Windows services. Once this is done, you can delete any files associated with the service.
To confirm that the service has been removed, you can press the refresh button in the Services Manager to check that it has been successfully deleted.
Deleting Windows services via registry editor
Attempting to delete a Windows service using the registry should be a last resort if the above method fails, as making a mistake when editing the registry risks damaging your Windows installation. As previously mentioned, make sure you take a backup before attempting these steps:
- Right-click on the Start menu, click Run, and enter regedit.
- Back up the registry by selecting Export from the File menu.
- Follow the same process as in the previous Command Line steps to open the Services Manager console to find the name of the service you want to delete, and stop it if it is running.
- Navigate to the Services key at the path: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices
- Find the service you wish to delete by scrolling through the list of registry keys in the navigation tree in the left pane, and clicking on the folder icon next to the entry will display additional information.
- In the left pane, right-click on the folder for the service you want to remove, and click Delete.
- Confirm the deletion, and restart your computer.
The reboot step is necessary to reload the registry. Again, you can confirm that the service was successfully removed by checking the Services Management console.
Comparing the Command Line and registry methods
You should try to use the sc delete command from the command line whenever possible. This method is far safer as it reduces the chance of mistakenly deleting the wrong registry key and doesn’t require a restart. It also handles removing other configurations such as scheduled tasks and error logging, as well as any service accounts the process used.
Delete Windows service from command-line FAQ
Can I recover a deleted Windows service?
You cannot recover Windows service that has been uninstalled without re-installing the original application, or restoring from a system backup.
What happens if I delete a service that Windows needs?
If you delete a service that Windows relies on, your PC may not boot, or specific functionality related to the service may fail (for example, automatic updates will stop working if you disable the Windows Update service).
Are there third-party tools for deleting Windows services that are easier to use?
NSSM (Non-Sucking Service Manager) is a free and open-source tool for managing Windows services that includes functionality for deleting Windows service.
How do I clean up after removing a Windows service?
Using the sc delete command will clean up much of the configuration for a service, but files from the original application may still be left behind in your Program Files folder and other directories. You’ll need to find these yourself and manually remove them.
Windows service management best practices for organizations
If you want to make sure that only approved software is running on your fleet of Windows devices, endpoint management software by NinjaOne helps you remotely patch and manage your Windows machines, ensuring they are not harboring malware in their hidden services, and providing full visibility over your IT infrastructure and end-user devices.