FIX: SC OpenService FAILED 5: Access is denied (Solved)
If you trying to delete a service from command prompt using the "sc delete" command and you receive the error "[SC] OpenService FAILED 5: Access is denied", in this guide you'll find two reliable methods to resolve the error.
The "[SC] OpenService FAILED 5: Access is denied" error usually occurs when the user trying to delete a Windows service does not have the required permissions to do so. In other cases, the error may occur even if the user has the required permissions, e.g. when a service has been corrupted or due to special permissions that prevent its deletion.
How to fix: "SC OpenService FAILED 5: Access is denied" error in "SC DELETE" command.*
* Important: Before continuing with the methods below, make sure that:
1. You are logged into Windows with a user who has administrator rights.
2. You run the "sc delete" command at the administrator command prompt.
3. The service you're trying to delete is not running. To stop a service from command prompt, use one of these commands:
- sc stop "service name"
- net stop "service name"
Method 1. Delete Service from Registry.
The first method to resolve the error ""[SC] OpenService FAILED 5: Access is denied". is to remove the service in Registry:
1a. Press the Windows + R keys to open the Run command box.
1b. Type regedit and press Enter to open the registry editor.
2. In Registry Editor, navigate to this location:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
3. Under the "Services" key locate the service that you cannot delete from command prompt.
4. Then right-click on the service and choose Delete. Then click Yes to confirm. *
* Note: If you receive an error when deleting the service, follow the instructions on method-2 below.
5. Close the Registry Editor and reboot the machine to apply the change and you're done!
Method 2. Delete Service using Autoruns.
The second way to delete a service that displays the error "SC OpenService FAILED 5: Access is denied" when you try to delete it using the "sc delete" command, is by using Autoruns.
Autoruns is a utility developed by Sysinternals, which is now part of Microsoft. Autoruns allows users to view and manage the programs, processes, services and drivers that automatically start with Windows.
To delete a service with Autoruns.
1. Download Autoruns and Autorunsc from https://learn.microsoft.com/en-us/sysinternals/downloads/autoruns
2. When the download is completed extract the downloaded Autoruns.zip file to a folder.
3. Explorer the folder's contents, right-click to Autoruns64.exe* and choose Run as administrator.
* Note: If you own 32-bit Windows, right-click on Autoruns.exe.
4. In 'Autoruns' select the Services tab, right-click on the service you want and select Delete to remove it.
5. Restart you PC and you're done!
That's all folks! Did it work for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.
- How to Resize Recovery Partition on Windows 10/11. - September 3, 2024
- FIX: 0x80780119 – System Image Backup failed. There is not enough space to create the volume shadow copy (Solved) - July 31, 2024
- Windows failed to apply the {F312195E-3D9D-447A-A3F5-08DFFA24735E} settings in gpupdate /force command (Solved) - July 23, 2024