0

using golang example I created windows service application, as mentioned in documentation I configured with service user and password. I'm using a batch script that will execute

    @REM install windows service using that application.
    app install
    timeout /t 5 /nobreak > NUL

    @REM start service using sc.exe command.
    sc.exe start testapp

it works fine with "Administrator" account.

But if the same service is installed under "test" user which had admin rights it, it won't star the service. I need to do manual log on from "services.msc" then it works, username and password are correct.

manual log on message

Is there any way I can do this log on in batch script? or this is expected behavior ?

Note that during "install" operation service username and password are configured with this "test" user. And "test" has "Log on as a service" rights based on this.

1 Answer 1

0

If windows service need to be installed under different user. That user should have "Log on as a service" permission. Without that service won;t start. Check this here

There are lot of powershell scripts there to do this. Incase this need to be enabled using batch or something.

In my case, that another user should have admin right , as well as "log on as a service" permission , after adding this permissions it works fine for me.

You must log in to answer this question.

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