windows 如何远程启动不同系统上的应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/717577/
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
How can I start an application on a different system remotely?
提问by Firoso
I've got a situation where i have one system running a master application that communicates with slave applets on other systems, problem is, i can't guarentee that the slave applets will be running, nor that an operator can physically utilize the system to start the applet (and I'm also assuming they don't know how to use Remote desktop, these are minimum wage test operators)
我遇到过这样一种情况,我有一个系统运行一个主应用程序,该应用程序与其他系统上的从属小程序通信,问题是,我不能保证从属小程序会运行,也不能保证操作员可以物理地利用该系统来启动小程序(我还假设他们不知道如何使用远程桌面,这些是最低工资测试操作员)
Is there an easy way to remotely launch an executeable on another system?
有没有一种简单的方法可以在另一个系统上远程启动可执行文件?
security is not a concern here as this is a closed network.
安全性在这里不是问题,因为这是一个封闭的网络。
回答by Piskvor left the building
回答by Kev
WMI is your friend. See the following article which covers starting processes locally and remotely using WMI:
WMI 是您的朋友。请参阅以下文章,其中介绍了使用 WMI 在本地和远程启动进程:
How To: (Almost) Everything In WMI via C# Part 2: Processes (CodeProject)
如何:(几乎)WMI 中的所有内容通过 C# 第 2 部分:进程(CodeProject)
Kev
凯夫
回答by Jason DeFontes
You can use the Windows AT commandto schedule tasks on a remote machine.
您可以使用Windows AT 命令在远程机器上安排任务。
回答by John Saunders
Any chance of converting the remote applets into Windows services? They can be configured to start when the system starts; to retry if they fail; and to notify someone if there are problems. They're quite trivial to create with Visual Studio.
有机会将远程小程序转换为 Windows 服务吗?它们可以配置为在系统启动时启动;如果失败就重试;并在出现问题时通知某人。使用 Visual Studio 创建它们非常简单。
回答by abhilash
here's a 2 step solution
这是一个两步解决方案
- Write a batch file to kick start the application/service in the context
- Have the batch file on a shared network path which can be accessed from the machine would like to launch the application/service.
- 编写一个批处理文件以在上下文中启动应用程序/服务
- 将批处理文件放在可以从要启动应用程序/服务的机器访问的共享网络路径上。
Honestly, I would suggest the PsExec solution by Piskvor. But you can try out this as well ;)
老实说,我建议 Piskvor 使用 PsExec 解决方案。但是你也可以试试这个 ;)
回答by Eamonn O'Connor
another simple solution if you're not on the same network (accessing your home computer to run teamviewer for example) is to create a rule in Outlook (if you have it) whereas if you receive an email say from yourself, you can have it start an application if there are certain pieces of text in the message body or subject line, for example:
如果您不在同一个网络上(例如访问您的家用计算机以运行 teamviewer),另一个简单的解决方案是在 Outlook 中创建一个规则(如果您有),而如果您收到一封来自您自己的电子邮件,您可以拥有它如果邮件正文或主题行中有某些文本,则启动应用程序,例如:
Create a mailbox rule: Step 1 - Conditions: From & With specific words in the body (from being your mail address and the message body: Start Teamviewer Step 2 - Start Application (browse to the location of the .exe you want to launch) Step 3 - enable that bad boy!
创建邮箱规则:第 1 步 - 条件:发件人和正文中包含特定字词(来自您的邮件地址和邮件正文:启动 Teamviewer 第 2 步 - 启动应用程序(浏览到您要启动的 .exe 的位置)第 3 步 - 启用那个坏男孩!
Obviously, you have to have Outlook open and accepting incoming mail in order for this to work.
显然,您必须打开 Outlook 并接受传入的邮件才能使其正常工作。
you can tailor this to your requirements, ie: if Start Teamviewer is too easy, you can put codes or passwords in there too, so when the email arrives, it'll read the message, recognise the info based on the rule, and launch the application. :)
您可以根据您的要求进行定制,即:如果启动 Teamviewer 太简单,您也可以在其中输入代码或密码,这样当电子邮件到达时,它会读取消息,根据规则识别信息,然后启动应用程序。:)