gpt4 book ai didi

.net - 使用InstallUtil并静默设置Windows服务登录用户名/密码

转载 作者:行者123 更新时间:2023-12-03 06:03:56 29 4
gpt4 key购买 nike

我需要使用InstallUtil来安装C# Windows服务。我需要设置服务登录凭据(用户名和密码)。这一切都需要默默地完成。

有没有办法做这样的事情:

installutil.exe myservice.exe /customarg1=username /customarg2=password

最佳答案

比上面的帖子更简单的方法并且在安装程序中不需要额外的代码是使用以下内容:

installUtil.exe /username=domain\username /password=password /unattended C:\My.exe

只需确保您使用的帐户有效即可。如果没有,您将收到“帐户名称和安全 ID 之间未完成映射”异常

关于.net - 使用InstallUtil并静默设置Windows服务登录用户名/密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/140054/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com