Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What do I need to grant permission for creating a service in Windows server 2008 R2?

I have added the user to the local "Administrators" group.

This is the error message:

C:\temp>sc create test  binpath=c:\temp\test.exe
[SC] OpenSCManager FAILED 5:
Access is denied.
share|improve this question
    
Your command line, as entered in your question, isn't valid. There should be a space after the "=" in "binpath=". That's not your problem, though. That's probably just a transcription error. –  Evan Anderson Aug 9 '10 at 13:23
add comment

5 Answers

I ended up temporarily disabling UAC and installing service like so:

  • Set HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA to 0 as Administrator
  • Reboot
  • Create service as non-Administrator user
  • Then set HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA back to 1 as Administrator
  • Reboot
share|improve this answer
add comment

You need to run the cmd prompt as an administrator. By default you will not have the correct rights to do this.

share|improve this answer
    
This can be done by right clicking the command prompt > Run as administrator –  JamesK Aug 9 '10 at 13:14
add comment

Is test.exe really configured to create a service? You can't make just ANY exe be a service, the exe must be created correctly. I once tried adding notepad.exe as a service. Won't work.

share|improve this answer
add comment

I have changed the Service Permissions Right Click on Service-> Properties -> Sercurity -> Give Full control to Users.

Worked for me.

share|improve this answer
add comment

Never used sc. Have you tried installutil?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.