1

I have a windows service that I've written. I'd like to make it easy for my server team to install it. So I'm building a little batch script.

One of the things that I require is for it to be setup with "Log on as:" set to "Local System account"

By default when I install it with C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe myService.exe it comes up with the "This Account" option.

Is there a way I can configure that option from the command line?

BIBD
  • 1,866
  • 10
  • 30
  • 44

1 Answers1

2

Use:

sc.exe config myServiceName obj= "LocalSystem"

with sc you can change all kinds of configuration settings for a service.

Note the weird syntax with a space after the equal sign.

Peter Hahndorf
  • 14,058
  • 3
  • 41
  • 58