windows 通过命令行配置windows服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/708875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:14:54  来源:igfitidea点击:

Configure windows service through command line

windowscommand-lineservice

提问by Bharani

I need to enable the "Allow service to interact with desktop"option in the service propertiesthrough command line.
How to accomplish that?
I tried the "sc"command. But I can't achieve what I need.

我需要通过命令行在服务属性中启用“允许服务与桌面交互”选项。 如何做到这一点? 我尝试了“sc”命令。但我无法实现我所需要的。

回答by Andrei Serdeliuc ?

Have you tried "sc config servicename type= interact type= own"

您是否尝试过“sc config servicename type= interact type= own”

Also: http://social.microsoft.com/Forums/en-US/vcgeneral/thread/3311c5b7-be80-466e-8d49-fc431115aea9/

另外:http: //social.microsoft.com/Forums/en-US/vcgeneral/thread/3311c5b7-be80-466e-8d49-fc431115aea9/

回答by 1800 INFORMATION

Keep in mind that this feature is pretty much going away in newer versions of windows, for example in Vista it is ignored - services are no longer allowed to interact with the desktop for security reasons

请记住,此功能在较新版本的 Windows 中几乎消失了,例如在 Vista 中它被忽略 - 出于安全原因不再允许服务与桌面交互