0

好吧,我正在尝试在远程计算机上运行“记事本”(例如),这是我的代码:

object[] theProcessToRun = { "notepad.exe" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Username = "My UserName";
theConnection.Password = "My Password";
ManagementScope theScope = new ManagementScope("\\\\" + ipAddress + "\\root\\cimv2", theConnection);
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);

(我能够连接到远程计算机)。什么都没有发生 - 程序正确退出,但遥控器上没有运行任何东西。

有任何想法吗?

谢谢!

4

0 回答 0