日期:2014-05-17 浏览次数:21270 次
ManagementScope sc = ConncetClient(ip, userName, pwd);
if (sc.IsConnected)
{
ObjectGetOptions obj = new ObjectGetOptions(null, System.TimeSpan.MaxValue, true);
ManagementPath mp = new ManagementPath("Win32_Process");
ManagementClass processClass = new ManagementClass(sc, mp, obj);
ManagementBaseObject inParams = processClass.GetMethodParameters("Create");
inParams["CommandLine"] = "calc.exe";
ManagementBaseObject outParams = processClass.InvokeMethod("Create", inParams, null);
}