2

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.
1
  • 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. Aug 9, 2010 at 13:23

5 Answers 5

2

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
1

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

1
  • This can be done by right clicking the command prompt > Run as administrator
    – JamesK
    Aug 9, 2010 at 13:14
1

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.

1

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

Worked for me.

0

Never used sc. Have you tried installutil?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .