さて、リモートコンピューターで「メモ帳」(たとえば)を実行しようとしています。コードは次のとおりです。
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);
(リモートコンピューターに接続できます)。何も起こりません - プログラムは正常に終了しますが、リモートでは何も実行されていません。
何か案は?
ありがとう!