[英]How can I run the application written in Golang as a Windows service
[英]How to set a login user account for a windows service written in Golang?
I use the package "https://pkg.go.dev/github.com/kardianos/service" to run an application written in Go as a Windows service.
我在service.Config
中设置了以下属性:
Username: "myusername"
Option: service.KeyValue{"password": "mypassword"}
当我然后安装程序时,我收到以下错误: The account name is invalid or does not exist, or the password is invalid for the account name specified.
我应该如何设置service.Config
的属性以使服务在安装时使用指定的凭据正常运行?
我只是自己找到了解决方案。
Username:`DESKTOP-XXXXXX\myAcount`
Option: service.KeyValue{"password": "mypassword"}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.