Windows Service : error 5 :Access Denied

十年热恋 提交于 2019-12-03 15:44:48
Vaibhav Singh

I am not sure if you've already got this resolved though, the following helped me fix this on my system:

  • Grant full permissions to the service registry key under HKLM > System > Current Control Set > Services > <Service Name>. (Grant full permissions to Network Service Built in account on the key)
  • Check the image path (apparently the output path of the exe under the bin > Debug.
  • Add and give full permissions to the Network Service account here too.

This should help!

I got an access denied error 5 when I tried to run a service under "LOCAL SERVICE" user, but under "LOCAL SYSTEM" the service did start. To run the service under "LOCAL SERVICE" I had to do the following:

  • Service set to run under "LOCAL SERVICE"
  • I gave permissions to the user "LOCAL SERVICE" for the folder where the executable of the service is located in. (Right mouse button om folder, properties, security, add user "LOCAL SERVICE" with as many rights as possible
  • Start service now

You can use procmon.exe of SysInternals to monitor the ACCESS DENIED error. Filter on "File System Activity" for the process "services.exe". You will probably see the path of the executable of the service that needs to be started in the "Path" column when the error "Access Denied" error code 5 occures.

Alexander Zaldostanov

This worked for me

Go to the service in the service manager >> right click on that service and choose Properties >> Click the Log On tab >> choose the Local System account.

Then start the service.

Through which user account type are you trying to start/stop the service? Make sure the user has sufficient privileges to start/stop a service.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!