HOWTO · PowerShell
How to Delete Services Using PowerShell
Identify an orphaned Windows service, confirm its short name, remove it with an available PowerShell command or sc.exe, and verify the result.
On this page
An orphaned service is still registered with Windows after the application that installed it has been removed. Before deleting one, identify what it does and confirm that no installed software or Windows component still depends on it. Removing the wrong service can stop software from working; deleting an entry does not promise a performance or reliability improvement.
This guide shows how to find a service’s short name, choose a removal command available in the current PowerShell session, and check whether the service remains registered. Run service-management commands from an elevated PowerShell session when Windows denies access. These commands affect Windows services and are not demonstrated as executed in this article.
Understand Orphaned Services and the Risks
The Services console and PowerShell display both a service’s short name and its descriptive display name. A leftover registration alone does not prove that a service is safe to remove. Check the service’s publisher, associated software, dependencies, and purpose first. If its role is unclear, leave it in place and investigate with the software vendor or system administrator.
Service removal changes the Service Control Manager configuration. It is not the same as stopping a service, and deleting a service does not uninstall its associated application or remove every file it installed. Keep a record of the service name and provider so you can identify what must be reinstalled if the deletion breaks dependent software.
Find the Service Name
Open PowerShell with administrative privileges if your account is permitted to manage services. List registered services and identify the candidate by its display name or other known details:
Get-Service
The Name value is the service short name used by the removal commands below; DisplayName is the human-readable label. Search by a distinctive display-name fragment when the list is long, for example, Get-Service | Where-Object DisplayName -like '*Example*'.
Replace Example with a fragment you recognize, then verify the returned service’s purpose before acting. A service may be running; its status is useful context, but it does not establish whether deletion is safe.
Run this self-contained example to format a confirmed short name for the commands above. It does not change a service:
$serviceName = 'ExampleSvc'
Write-Output "Selected service: $serviceName"
Delete a Service with PowerShell
First check whether Remove-Service is available in the current session:
Get-Command Remove-Service -ErrorAction SilentlyContinue
If the command is returned, use the service short name in -Name:
Remove-Service -Name 'ExampleSvc'
Substitute the confirmed short name for ExampleSvc. If the service is running and removal is refused, stop it only after confirming that doing so will not interrupt needed work, then retry the removal:
Stop-Service -Name 'ExampleSvc', followed by Remove-Service -Name 'ExampleSvc'.
If Remove-Service is unavailable in this session, open an elevated PowerShell session and use the Windows Service Control utility with the same short name:
sc.exe delete ExampleSvc
Spell the executable as sc.exe: in PowerShell, sc is an alias for Set-Content. The delete request removes the service registration; it does not remove the application files. sc.exe may report that deletion is pending while the service is still active or has open handles. Allow it to stop and close, then check again. These Windows-specific commands are examples and have not been executed here.
Verify Removal and Troubleshoot Errors
Query the specific short name after the removal request:
Get-Service -Name 'ExampleSvc' -ErrorAction SilentlyContinue
If the service is returned, it remains registered. Check that you used the short name, that the command ran with suitable privileges, and whether the service is still running or marked for deletion. If no service is returned, the query did not find that name; this is a useful verification check, but it does not confirm that related application files were removed.
An error saying a command is unavailable means that command cannot be used in the current session; use the elevated sc.exe delete fallback where appropriate. An access-denied error calls for an authorized elevated session, not repeated attempts from an account without permission. If Windows cannot find the named service, recheck the Name value from Get-Service for a spelling mistake or confirm whether it has already been removed. Do not infer exact success or failure wording, because messages can vary by command and environment.
FAQ
Can I delete any service?
No. Some services support Windows or installed software. Confirm the service’s purpose and dependencies before removing it; when uncertain, do not delete it.
What if the service is running?
Stop it only if it is safe to interrupt. If Windows still reports that deletion is pending, wait for the service to stop and release its handles, then verify its registration again.
Can I restore a deleted service?
There is no general undo command for a removed service registration. Recovery may require repairing or reinstalling the software that supplied the service, or following its vendor’s documented recreation procedure.