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.

2
  • What version of Windows is this?
    – uSlackr
    Jun 8, 2011 at 13:06
  • I'm testing this on Win7 but it should apply to XP as well and corresponding server versions
    – alh84001
    Jun 8, 2011 at 13:09

4 Answers 4

-1

This should work: SC CONFIG MyService binPath=c:\myprogram.exe obj=".\LocalSystem" password=""

2
  • Look at some of the examples here: ss64.com/nt/sc.html
    – Chris N
    Jun 8, 2011 at 13:16
  • 1
    Thank you. I took that last example, and played with it and finally got it to work with SC.EXE CONFIG MyServiceName obj= "\Local Service" password= ""
    – alh84001
    Jun 8, 2011 at 15:09
8

To be clear, the proper command is:

SC CONFIG MYSERVICENAMEHERE obj="NT AUTHORITY\LocalService" password= ""
1
  • For me (Windows 10) it only worked without the password property
    – Valentin
    Jul 22, 2021 at 16:12
4

@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.

3

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

You must log in to answer this question.

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