11

I am getting the following message while trying to remove a windows service with SC command?

C:\Users\chacha>sc delete service_name
[SC] OpenService FAILED 5:

Access is denied.

I tried to change the properties of Service and retried to remove them but failed. Even I disabled the service and restarted the machine :(

Any idea on forcefully removing a service? What is the reason for this "Locking"?

1
  • Did you do that from an elevated command prompt? Aug 31, 2009 at 6:21

3 Answers 3

19

Try deleting it's entry from regedit at:

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services

Make sure you reboot afterwards.

Also:

  • Try removing the service while in safe mode.
1
  • 1
    Regedit doesn't let me remove TrustedInstaller key. Aug 28, 2018 at 12:05
2

You could try using Sysinternals Autoruns program to disable or delete the service.

1
  • Tried that... "access denied"
    – marcolopes
    Dec 18, 2023 at 20:06
2

That's because you need admin rights.

Before opening cmd.exe right click it and select "Run as administrator". Also you can hold CONTROL+SHIFT and press ENTER to open it with admin rights.

2
  • Even so, same error!
    – marcolopes
    Dec 18, 2023 at 20:06
  • @marcolopes Then you are trying to remove a system service, or a service with more rights than your admin user. Dec 18, 2023 at 21:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .