How to Resolve SC OpenService Failed 1060 on Windows Server 2016
If you’ve ever typed sc query or tried to start a service from the command line and were greeted with “OpenService failed: 1060”, you know how frustrating it can be. The error code 1060 translates to “The service does not exist”, but the message often masks deeper issues—missing registry entries, corrupted service binaries, or permission quirks. Below we’ll walk through what triggers this problem on Windows Server 2016 and how to fix it without pulling your hair out.
Understanding the 1060 Error on Windows Server 2016
When the Service Control (SC) utility attempts to open a service, it looks for a matching entry under HKLM\System\CurrentControlSet\Services. If the key is absent or malformed, the API returns 1060. In many cases the service was removed improperly, a recent update renamed it, or the underlying executable was moved.
Because the error surfaces through the SC command, administrators often assume the service is gone for good. In reality, the service’s registry data may still be there but points to an invalid binary path, causing SC to think the service “doesn’t exist”.
Pre‑flight Checklist Before Diving Into Fixes
- Run the command prompt as an administrator – many service‑related actions fail silently without elevated rights.
- Identify the exact service name you’re targeting (the
service_nameparameter, not the display name). - Make a quick backup of the
HKLM\System\CurrentControlSet\Serviceskey usingreg exportso you can roll back if needed.
Step‑by‑Step Repair Guide
1. Verify the Service Exists in the Registry
Open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. Look for a sub‑key that matches the service name you typed. If it’s missing, the service truly isn’t registered – you’ll need to reinstall it or recreate the key manually.
2. Re‑create a Missing Service Entry
When you know the service’s executable path, you can rebuild the registry key. Open an elevated PowerShell window and run:
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyService"New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyService" -Name "ImagePath" -Value "`"C:\Program Files\MyApp\myservice.exe`"" -PropertyType String
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\MyService" -Name "Start" -Value 2 -PropertyType DWord
Adjust MyService and the path to reflect your environment. After creating the key, run sc query MyService again; the error should disappear.
3. Repair a Corrupted Service Path
If the registry key exists but points to a non‑existent file, correct the ImagePath value. Right‑click the key, choose “Modify”, and paste the proper executable location. Remember to wrap the path in quotes if it contains spaces.
4. Check Service Permissions
Even with a valid registry entry, SC may reject the request if the account you’re using lacks SC_MANAGER_CONNECT rights. Use subinacl or the built‑in sc sdshow/ sc sdset commands to examine the service’s security descriptor. A typical fix looks like:
sc sdshow MyService | sc sdset MyService D:(A;;CCLCSWRPWPDTLOCRRC;;;AU)This grants the “Authenticated Users” group the necessary permissions. Replace MyService with your actual name.
5. Re‑install the Service Package
When the above steps feel like patchwork, the cleanest route is to reinstall the component that provides the service. Most Windows features expose an installutil.exe or a dedicated installer. After reinstalling, run sc query to confirm the service registers correctly.
Additional Diagnostics You Might Need
Sometimes the 1060 code appears alongside other error numbers, like 1057 (“The account name is invalid or does not exist”). In those cases, the problem is usually with the service’s log‑on account rather than its registration. Use services.msc, locate the service, and double‑click to open properties. Under the “Log On” tab, verify the account name and password, or switch to “Local System” as a test.
Another hidden snag is Windows Server 2016’s “Service Hardening” policies, which can block services that don’t meet certain criteria (e.g., missing digital signatures). If you suspect this, check the Event Viewer under “Windows Logs → System” for entries mentioning “Service Control Manager” and a specific error ID.
Preventing Future OpenService Failures
- Whenever you remove a service, use the official uninstaller or
sc deleteto clean the registry automatically. - Document any manual changes to
ImagePathso you have a reference point for later audits. - Enable regular System State backups; a quick
wbadmin start systemstatebackupcan save you from a corrupted service registry. - Stay current with Windows Updates – Microsoft occasionally patches SC behavior that can misinterpret certain registry configurations.
Frequently Asked Questions
Why does SC return 1060 even though the service appears in Services.msc?
Services.msc reads the same registry data, but it can sometimes display a service that is marked “disabled” or has a broken executable path. SC, on the other hand, tries to open the service handle directly and fails if the binary cannot be located.
Can I ignore the error if the service isn’t critical?
Technically you can, but lingering orphaned entries may clutter the Service Control Manager and cause confusion during future deployments. It’s best to clean them up, especially on production servers.
Is a reboot always required after fixing the registry?
Not always. After correcting the ImagePath or permissions, a simple sc start ServiceName often works. However, if you added a new service key, a restart ensures the Service Control Manager reloads the entire Services tree.
What tools can help automate these checks?
PowerShell scripts that enumerate Get-Service and cross‑reference with Get-ItemProperty under the Services registry key are handy. Open‑source modules like Carbon also provide functions to validate service configurations.