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.
link|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
feedback

3 Answers

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

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

Never used sc. Have you tried installutil?

link|improve this answer
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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