0

My code works fine on one computer but the same code generates error code 5 (access denied) on another computer. Essentially ::OpenService() call fails because of the flag SERVICE_START because the user doesn't have privileges to start the service. I know because it does start the service if I start the app as administrator.

I want the same privileges on the 2nd computer so any user can start a service but can't figure out which settings is responsible for that. I looked into group policy >> Computer Configuration >> Windows Settings >> Security Settings >> Local Policies >> User Rights Assingment.

I don't know if I am even looking at the right place. Does anyone know?

zar
  • 1,713
  • 5
  • 27
  • 43

1 Answers1

0

There is no global privilege for that. Instead all services have their own individual ACLs – although you cannot see them through services.msc, only through sc sdshow/sc sdset or third-party software. (Process Hacker is one such program; it includes a graphical ACL editor in its 'Services' tab.)

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • I send `sc showsd` output to a text file and compared for both PCs and they are identical. The PC where it works is Windows 7, the one where it requires admin privileges, is Windows 10. Could that make any difference? – zar Sep 19 '18 at 19:27