Automatically start a Windows Service on install

前端 未结 13 1373
轻奢々
轻奢々 2020-11-28 19:13

I have a Windows Service which I install using the InstallUtil.exe. Even though I have set the Startup Method to Automatic, the service does not start when installed, I have

13条回答
  •  情书的邮戳
    2020-11-28 19:52

    Use ServiceController to start your service from code.

    Update: And more correct way to start service from the command line is to use "sc" (Service Controller) command instead of "net".

提交回复
热议问题