/

How to Delete Windows Service from Command-Line and Registry

by Lauren Ballejos, IT Editorial Expert
How to Delete Windows Service from Command-Line and Registry blog banner image
How to Delete Windows Service from Command-Line and Registry blog banner image

Try our #1 rated endpoint management platform on G2

NinjaOne dashboard screenshot

Automate the Hardest Parts of IT

Key Points

How to Delete a Windows Service from Command Line and RegistryStop the service before deletion:

  • Use sc stop SERVICENAME in the Command Prompt or stop it in the Services console.
  • Ensure you have administrator privileges.

Delete via Command Prompt:

  • Open elevated Command Prompt (“Run as Administrator”).
  • Type sc delete SERVICENAME and press Enter.
  • Verify service removal with sc query or Services console.

Delete via Windows Registry (if command line fails):

  • Backup the registry (regedit → File → Export).
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
  • Locate the service folder, right-click, and delete it.
  • Restart your PC for changes to take effect.

Compare methods:

  • Command line deletion is safer, faster, and avoids registry errors.
  • Registry deletion is a fallback, but riskier and requires a

Precautions:

  • Do not delete critical Windows services—could break system functions.
  • Always back up before making changes.

This tutorial provides step-by-step instructions on how to delete a Windows service from the command line or, if necessary, from the Windows Registry. These instructions work on both Windows 10 and Windows 11 and allow you to remove orphaned or unwanted services.

See the video on How to Delete Windows Service from Command-Line and Registry.

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 must run continuously and don’t require ongoing interaction. For example, antivirus software 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 is needed, it can communicate with an associated desktop application that prompts you to review its findings, install an update, etc.

Services differ from standard applications in that they don’t have a direct interface and don’t appear in the system tray or start bar, effectively hiding them from you during day-to-day use. Most services are built into Windows, providing sound, networking, and audio functionality. Others are added by third-party applications such as antivirus software, firewalls, and file-sharing or networking platforms.

You may want to delete a service on Windows. This is 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 performing any maintenance on your Windows PC, you should back up 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 to avoid accidentally removing the wrong service. It could be something your system relies on to function properly.

Reduce possible downtime and protect vital data with reliable and consistent Windows backup software.

Discover what NinjaOne Windows Backup can do for you.

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.

Deleting Windows Services via the Command Line
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 refresh the button in the Services Manager.

Deleting Windows services via the registry editor

Attempting to delete a Windows service directly from the Windows Registry should only be used as a last resort if the sc delete command fails or the service entry has become orphaned. Making a mistake while editing the registry can damage 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
  • Follow the same process as in the previous Command Line steps to open the Services Manager Then find the service you want to delete and stop it if it is running.
  • Navigate to the Services key at the path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  • Find the service you want to delete by scrolling through the registry keys in the left pane. Selecting the service key displays its values in the right pane, allowing you to verify that you have located the correct service.
  • 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 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. This is because it reduces the chance of mistakenly deleting the wrong registry key and doesn’t require a restart. It also removes the service registration from the Service Control Manager (SCM). However, application files, scheduled tasks, event log sources, registry entries outside the service key, and other components installed by the application may still need to be removed separately.

Gain full visibility and control over Windows services and other programs to optimize device performance.

Learn more about NinjaOne Windows Endpoint management or try it for free.

Windows service management best practices for organizations

If you want to ensure only approved software runs on your Windows fleet, choose NinjaOne Endpoint Management, which lets you remotely patch and manage your Windows devices.

This ensures they are not harboring malware in their hidden services, and provides full visibility over your IT infrastructure and end-user devices.

FAQs

You generally cannot recover a deleted Windows service without reinstalling the original application, restoring it from a system backup, or recreating it manually if you know its original configuration.

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).

NSSM (Non-Sucking Service Manager) is a free and open-source utility for managing Windows services. Although it is primarily intended for creating and managing services, Windows’ built-in sc delete command remains the recommended method for removing services.

Using the sc delete command removes the service registration from Windows, but files from the original application and other components may still remain in your Program Files folder and other directories. You’ll need to find these yourself and manually remove them.

You might also like

Ready to simplify the hardest parts of IT?