简体   繁体   English

如何切换到Windows服务的桌面

[英]How to switch to the Desktop of Windows Service

I created a windows service and marked the CheckBox "Allow service to interact with desktop" in "Log On" tab of service properties. 我创建了Windows服务,并在服务属性的“登录”选项卡中选中了“允许服务与桌面交互”复选框。 The service opens a windows application (.exe) but I don't know that what is the progress of the opened .exe. 该服务会打开Windows应用程序(.exe),但我不知道打开的.exe的进度如何。 Is there a way that I could switched to the desktop of the service? 有什么方法可以切换到服务的桌面吗?

The service "logged on as" is "Local System" “登录为”服务是“本地系统”

(I am sure that the .exe is opened by the service because when I try to modify/move/delete, the message is returned that it is being used by another process) (我确定该服务会打开.exe,因为当我尝试修改/移动/删除时,会返回该消息正在被另一个进程使用)

Services do not have a desktop, so you can't switch to it. 服务没有桌面,因此您无法切换到该桌面。 They might have very limited Windows-version-dependent access to a user's desktop, but you can't count on it and shouldn't use it. 他们对用户桌面的Windows版本依赖访问可能非常有限,但是您不能指望它,也不应使用它。

Also, if you're running terminal services in a version of Windows that can do desktop I/O and the service is configured for it, the I/O goes to the first desktop. 另外,如果您在可以执行桌面I / O的Windows版本中运行终端服务,并且已为其配置了服务,则I / O会转到第一个桌面。 If that's not you, you won't see it. 如果不是您,您将看不到它。

I am sure that the .exe is opened by the service because when I try to modify/move/delete, the message is returned that it is being used by another process 我确定服务会打开.exe,因为当我尝试修改/移动/删除时,返回的消息是它正在被另一个进程使用。

You would need to stop the service before you can move/delete/replace the exe. 您需要先停止服务,然后才能移动/删除/替换该exe。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Windows服务安装程序中设置“与桌面交互” - How to set “interact with desktop” in windows service installer 如何实现 Windows 桌面服务和 Windows 桌面应用程序之间的通信? - How can I achieve communication between a windows desktop service and a windows desktop application? 如何从另一个桌面应用程序控制Windows服务 - How to control of windows service from a another desktop apps 如何在代码中配置我的Windows服务以访问桌面? - How can I configure my windows service in the code to access the desktop? 如何从与桌面交互的应用程序与Windows服务进行通信? - How to communicate with a windows service from an application that interacts with the desktop? 允许 Windows 服务与桌面交互 - Allow Windows service to interact with desktop Windows服务和在不同计算机上运行的桌面应用程序之间如何通信 - How to communicate between a windows service and a desktop application running on different machines 如何在windows服务安装时默认勾选“允许服务与桌面交互” - How to keep "Allow Service to interact with desktop" checked by default at the time of windows service installation 如何使用C#将消息从Windows服务传递到Windows桌面应用程序? - How to pass a message from windows service to windows desktop application using c#? 从 Windows 服务获取桌面大小? - Get Desktop Size from Windows Service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM