如何安装 windows 服务以管理员身份运行而不使用 GUI?

How do I install a windows service that runs as an administrator without GUI?

如果我们假设服务必须 运行 作为管理员,是否可以使用命令行(sc.exe、powershell - 都可用)安装它?

奖金:是否可以不提供密码?

sc.exe config 'servicename-notdisplayname' obj='\Administrator' password='secret'

仍然没有避免密码,因为启动服务时需要密码。