5

How can this problem be solved?

I know there is a sc utility, but I don't know how to assign the Local Service account to the obj parameter (because of the spaces in the name), and how to assign a blank password (I assume Local Service account has a blank password) to the password parameter.

alh84001
  • 153
  • 1
  • 1
  • 3

4 Answers4

8

To be clear, the proper command is:

SC CONFIG MYSERVICENAMEHERE obj= "NT AUTHORITY\LocalService" password= ""
Ray
  • 194
5

@Amir's answer was the closest, but spaces are needed after the equal signs. If you view the help for SC.EXE, you'll see:

NOTE: The option name includes the equal sign.
      A space is required between the equal sign and the value.

So to get this to work under the real Local Service account on Windows 2012 R2, the following worked:

SC.EXE CREATE TheServiceName start= auto binPath= "C:\path\to\TheService.exe" obj= "NT AUTHORITY\LocalService" password= ""

When I tried...

obj= "\Local Service"

...it didn't get set to run under the real Local Service account.

D Rickard
  • 51
  • 1
  • 1
4

Regarding previous comment, be aware that Local System and Local Service is not the same account. Local Service has much less rights.

DavisNT
  • 364
-2

This should work:

SC CONFIG MyService binPath= c:\myprogram.exe obj= "NT AUTHORITY\LocalService"
Ray
  • 194
Chris N
  • 725