You're staring at the Services panel seeing "MyNewService" listed, yet when you run:
sc delete MyNewService
Windows responds with the frustrating message: "The specified service does not exist as an installed service". This contradiction indicates we're dealing with either a registry artifact or a service display name vs. service name mismatch.
The most common culprit is confusing the service's display name (what you see in Services.msc) with its actual service name (what SC command expects). Try:
sc queryex type= service state= all | find /i "MyNewService"
This will show all services containing your search term, revealing the actual service name if it exists.
When the service is truly stuck, we need manual registry cleanup:
- Open
regedit
and navigate to:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
- Locate the problematic service key (may match display name)
- Right-click → Delete the entire service key
- Reboot to apply changes
Warning: Always export registry keys before deletion!
For more precise control, use these PowerShell commands:
# List all services with display names
Get-Service | Select-Object Name,DisplayName | Where-Object {$_.DisplayName -like "*MyNew*"}
# Force removal if registry key exists
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyNewService" -Force -Recurse
For stubborn services tied to running processes:
- Download Sysinternals Process Explorer
- Find the process associated with your service
- Right-click → Kill Process Tree
- Proceed with registry cleanup
When creating services, always:
- Use simple, consistent naming (avoid spaces/special chars)
- Document both display name and service name
- Properly implement service uninstall logic in your installer
For development testing, consider this C# uninstall pattern:
using (ServiceController sc = new ServiceController("MyNewService"))
{
if (sc.Status != ServiceControllerStatus.Stopped)
{
sc.Stop();
sc.WaitForStatus(ServiceControllerStatus.Stopped);
}
System.Configuration.Install.ManagedInstallerClass.InstallHelper(
new string[] { "/u", "MyServiceExecutable.exe" });
}
We've all encountered this frustrating scenario - you try to delete a Windows service using the standard sc delete
command, only to be met with the error:
[SC] DeleteService FAILED 1060:
The specified service does not exist as an installed service.
Yet paradoxically, the service still appears in Services Manager (services.msc
) and might even be running. This typically happens when:
- The service registry entries weren't fully cleaned up during uninstallation
- There's corruption in the service's registry configuration
- The service was manually created with improper cleanup procedures
Before proceeding, back up your registry (File → Export in regedit). Then:
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\MyNewService" /f
If you need to remove all traces, also check these locations:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MyNewService
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\MyNewService
For stubborn cases, this PowerShell script will completely nuke the service:
# First check if service exists in any form
$service = Get-WmiObject -Class Win32_Service -Filter "Name='MyNewService'"
if ($service) {
# Force stop if running
if ($service.State -ne 'Stopped') {
Stop-Service -Name MyNewService -Force
}
# Delete via WMI
$service.Delete()
} else {
# Fallback to registry cleanup
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyNewService" -Recurse -Force -ErrorAction SilentlyContinue
}
# Final verification
Get-Service -Name MyNewService -ErrorAction SilentlyContinue
When creating custom services, always implement proper cleanup:
// In your service installer class
protected override void OnBeforeUninstall(IDictionary savedState)
{
using (var sc = new ServiceController(ServiceName))
{
if (sc.Status != ServiceControllerStatus.Stopped)
{
sc.Stop();
sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(30));
}
}
base.OnBeforeUninstall(savedState);
}
When all else fails, try these specialized utilities:
- Sysinternals
Autoruns
- Shows all service entries including hidden ones Process Hacker
- Advanced service management capabilitiesNirSoft ServiWin
- Low-level service editor