如何在C#WPF中使用WMI远程打开.exe文件? [英] How do I remotely open an .exe file using WMI in C# WPF?

查看:106
本文介绍了如何在C#WPF中使用WMI远程打开.exe文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在

Quote:

值不在预期范围内

。 InvokeMethod(Create,processToRun);

wmiProcess.InvokeMethod("Create", processToRun);



有什么问题?谢谢。



我的尝试:




What is wrong? Thanks.

What I have tried:

var processToRun = new[] { @"C:\Program Files\Lockheed Martin\Prepar3D v4\Prepar3D.exe" };
var connection = new ConnectionOptions();
connection.Username = "";
connection.Password = "";
var wmiScope = new ManagementScope(String.Format("\\\\{0}\\root\\cimv2", @"192.168.10.155"), connection);
var wmiProcess = new ManagementClass(wmiScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
wmiProcess.InvokeMethod("Create", processToRun);

推荐答案

您可以通过以下链接找到答案:



使用C#中的WMI创建远程进程 [ ^ ]

连接到WMI远程使用PowerShell(Windows) [ ^ ]



here



干杯,

--AH
Hey you can find your answer at the following links:

Create a Remote Process using WMI in C#[^]
Connecting to WMI Remotely with PowerShell (Windows)[^]

Some nice discussions are going around this topic in here:

Cheers,
--AH


这篇关于如何在C#WPF中使用WMI远程打开.exe文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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