这是我的代码:单击一个按钮,文本框中的文本将用于remotePC。我可以在本地运行它,但是当我尝试远程运行它时它将无法工作,我认为它与使用WMI运行共享文件有关?
public void IPXFER(string RemotePC)
{
object[] theProcessToRun = { @"\\network-share\ipxfer\ipxfer.exe -s corp-trend -p 1234 -m 1 -c 12345" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Impersonation = ImpersonationLevel.Impersonate;
theConnection.EnablePrivileges = true;
ManagementScope theScope = new ManagementScope("\\\\" + RemotePC + "\\root\\cimv2", theConnection);
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);
}