How to Delete a Service in Windows 10 and earlier

Have you come across a situation where uninstalling a software leaves its Service or driver entries in the registry, and Windows tries to load them at every boot, fails and logs the error to the System Event log at every startup?

This post tells you how to delete an orphaned service in Windows 10, 8, 7 & Vista using the registry, SC.exe command-line, or using Autoruns. Before proceeding further, create a System Restore point and/or a complete Registry backup.

How to Delete a Service in Windows?

If you find that no dependents exist for a service, you can proceed to delete the leftover or unwanted Service in Windows using one of the following methods.

Method 1: Delete a Service Using the SC.EXE command

The SC command-line tool in Windows can be used to create, edit or delete Services. To delete a service in Windows, use the following command-line syntax from admin Command Prompt:

sc delete service_name

Where service_name refers to the short name or the key name of the service, instead of its display name.To find the short name, open Services MMC and double-click a service.
  • Example 1: Short name for Automatic Updates is wuauserv, and the display name is “Automatic Updates.”
  • Example 2: Google Update Service (gupdate) is the display name, and gupdate is the short name
    Delete unwanted services

Another way to find the short name of a service is by using this command-line:

sc getkeyname "service display name"

which in this example is:

sc getkeyname "Google Update Service (gupdate)"

delete a service in windows - leftover service

Once the service short name is obtained using any of the above methods, use this command to delete the Service:

sc delete test

You’ll see the output: [SC] DeleteService SUCCESS

delete a service in windows - leftover service

This deletes the specified service (“test” service in this example) from the computer.

If the service is running, or another process has an open handle to the service, the service will be simply marked for deletion and removed on next reboot.

Method 2: Delete a Service Using Autoruns from Windows Sysinternals

Autoruns, from Microsoft Windows Sysinternals, is a must-have tool which helps you manage Windows startup, services, drivers, Winsock providers, Internet Explorer add-ons, Shell extensions and much more.

  1. Download Autoruns and run it
  2. From the Options tab, tick Hide Microsoft Entries, so that only the third-party entries are listed.
  3. Press F5 to refresh the listing.
  4. Click the Services tab, from where you can delete the service(s) which are unwanted or leftover.
    Delete unwanted services
  5. Close Autoruns.

Method 3: Delete a Service Using the Registry Editor

To manually remove a service from the Windows registry, use these steps:

  1. Start Regedit.exe and navigate to the following branch:
    delete a service in windows - regedit.exe leftover service
    Services registry key.

    Each sub-key under the above registry key represents a driver or a Service. The key name is also the short name of the service. Also, you should be able to identify the entry easily by looking at the DisplayName and ImagePath values in the right-pane in the Registry Editor.

  2. Find the entry you want to delete.
  3. Backup the appropriate key by exporting it to a .reg file.
  4. Once exported, right-click the key, and choose Delete.
  5. Exit the Registry Editor.

Method 4: Delete a Service Using PowerShell

From PowerShell administrator window, you can use the following commands to delete a service.

$service = Get-WmiObject -Class Win32_Service -Filter "Name='servicename'"

delete a service in windows - powershell

ReturnValue of 0 indicates that the operation was successful. The service is deleted and will now longer show up in the Services MMC.

To know the meaning for a return value, check out Microsoft article Delete method of the Win32_Service class

delete a service in windows - leftover serviceOr you can run the sc.exe command in PowerShell. That would work too. But you must use the file extension (sc.exe) when running it in PowerShell. This is because the command SC (without mentioning the extension .exe) will be interpreted as Set-Content which is a built-in cmdlet in PowerShell.

It’s even easier if you have PowerShell 6.0 installed. In PowerShell 6 and higher, you can use this syntax to remove a service:

Remove-Service -Name ServiceName

Running the Remove-Service command in older versions of PowerShell (<6.0) shows the error: The term ‘Remove-Service’ is not recognized as the name of a cmdlet, function, script file, or operable program.

View Dependents of a Service

When you remove a service, others that depend upon the service would fail to start, returning error “System error 1075 has occurred. The dependency service does not exist or has been marked for deletion.”. When a driver or service entry is leftover in the registry but the corresponding files are missing, the Event Log would record an entry with ID:7000 at every start.

Log Name: System
Source: Service Control Manager
Event ID: 7000
Level: Error
The DgiVecp service failed to start due to the following error:
The system cannot find the file specified.

So, it’s advisable to first check if there are any dependents. You can check that in Services MMC by double-clicking on the item you’re going to delete and clicking the Dependencies tab. The list of components that depend on that service are shown below. Here is an example, where “Fax” depends on “Print Spooler” to start.

Delete unwanted services

While most third-party services don’t have any dependents, some do. It’s always advisable to take a look at this tab before clearing the item.

Another way to verify the dependents is to run this command from a Command Prompt window. (example, Print Spooler)

sc enumdepend spooler

Delete unwanted service in windows

The information in this article applies to all versions of Windows, including Windows 10.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

About the author

Ramesh Srinivasan founded back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

11 thoughts on “How to Delete a Service in Windows 10 and earlier”

  1. Thanks. Great instructions. I used the elevated command prompt method.

    Removed the Dock Login Service that came with Dell Dock, because it wasn’t removed with the uninstaller. (Win 7 64 pro)

    If you want a dock, get a Mac

  2. SC worked fine in removing the MySQL service reference after I uninstalled xampp.



Leave a Comment