Windows Service:错误5:访问被拒绝 [英] Windows Service : error 5 :Access Denied

查看:76
本文介绍了Windows Service:错误5:访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个简单的Windows服务.该服务的用户帐户是 NetworkService .然后从命令提示符处运行 installUtil ,我得到了这个提示:

I am trying to create a simple Windows Service. The User Account for the service is NetworkService. Then I ran installUtil from command prompt and I got this :

提交阶段完成成功.

The Commit phase completed successfully.

交易安装已完成.

表示该服务已成功安装.但是,当我尝试从 Service applet 运行它时,出现此错误:

which means the service got installed successfully. But when I try to run it from the Service applet i get this error :

Windows不能在本地计算机上使用CustomersService服务.错误5:访问被拒绝.

我正在使用64位Windows 7.

I am using 64bit Windows 7.

推荐答案

我不确定您是否已解决此问题,以下内容可帮助我在系统上解决此问题:

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

  • 授予对 HKLM>下的服务注册表项的完全权限.系统>当前控制集>服务><服务名称> .(在密钥上授予内置网络服务"帐户的全部权限)
  • 检查图像路径(显然是 bin>调试下exe的输出路径.
  • 也在此处添加并授予网络服务帐户的完全权限.
  • 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.

这应该有帮助!

这篇关于Windows Service:错误5:访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆