每当Windows服务启动时自动打开一个exe [英] Open an exe automatically Whenever Windows Services Starts

查看:329
本文介绍了每当Windows服务启动时自动打开一个exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,





我创建了Windows服务以及其他Windows窗体,我的实际任务是打开.exe( Windows窗体)自动每当Windows服务启动时。我使用的是Windows 7操作系统..





先谢谢你

Dear Friends,


I have created Windows Services and also other windows forms my actual task is to Open an .exe (Windows Forms) automatically Whenever Windows Services Starts.I'm using Windows 7 OS..


Thanks in Advance

推荐答案

除了解决方案1中给出的信息之外,还要注意Windows服务不能直接与用户会话交互。对于Windows 7,这是一个严格的规则,称为会话0隔离(与XP不同,它仍然可以通过一些设置 - 虽然已经不鼓励)。因此,具有GUI的程序对于任何人都是可见的。

当登录用户想要与服务交互时,可以使用诸如.Net Remoting,WCF等其他一些技术。 。
Beyond the information given in solution 1, also note that a Windows Service MUST NOT interact directly with a user session. With Windows 7, that is a strict rule, called "session 0 isolation" (different from XP where it was still possible with some settings - though already discouraged). Consequently, that program with a GUI would be visible to nobody at all.
When a logged in user wants to interact with a service, some other technologies like .Net Remoting, WCF, etc. can be used.


这听起来像是马前的车问题。 Windows服务在计算机启动时以及任何用户登录之前启动。如果您的程序具有UI,则您几乎需要使用活动桌面登录才能显示程序UI。



有合理的例外,但您的描述不完整,可能无法完成。
This sounds like a "cart before the horse" problem. Windows Services start when the machine boots, and before any user logs in. If you have a program that has a UI, you pretty much need a user logged in with an active desktop to display the program UI.

There are reasonable exceptions to this but your description is not complete and likely can't be done.


这篇关于每当Windows服务启动时自动打开一个exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆