这是我的代码:单击一个按钮,并将textbox中的文本作为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);
}发布于 2010-05-07 04:02:33
我最终使用了file.copy,然后用WMI的开关执行exe,解决了这个问题。
https://stackoverflow.com/questions/2782811
复制相似问题