问题
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