Windows Service Error: Installog access is Denied

こ雲淡風輕ζ 提交于 2019-12-08 15:41:13

问题


I get following error while installing my Windows service through Command prompt

Access to the path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.In stallLog' is denied.

I am using following command:

C:\Windows\Microsoft.NET\Framework\v2.0.50727>installutil.exe "C:\Hive-WindowsService\HiveBatchProcess\HiveBatchProcess\bin\Debug\HiveBatchProcess.exe" -i

What could be wrong?


回答1:


do you have administrator rights ? Try to run the service setup by launching the command prompt as administartor.




回答2:


Try running from a different directory (eg %TEMP%)- it just needs access to write the log file to the current directory, and by default non-administrators can't write to {{c:\Windows}} subdirectories.

eg:

cd %TEMP%
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe" "C:\Hive-WindowsService\HiveBatchProcess\HiveBatchProcess\bin\Debug\HiveBatchProcess.exe" -i

Depending on what the install logic in HiveBatchProcess.exe does, you may or may not need additional permissions (eg registry access, write access to other directories, etc). But running installutil.exe does not strictly require administrator permissions.




回答3:


cd "%temp%" then "C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe" "\ourServiceexe.exe"

i changed the service password to admin password of the server



来源:https://stackoverflow.com/questions/5459643/windows-service-error-installog-access-is-denied

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