ManagementPath p = new ManagementPath("Win32_Product"); ManagementClass classInstance = new ManagementClass(scope, p, null); ManagementBaseObject inParams = classInstance.GetMethodParameters("Install"); inParams["AllUsers"] = true; inParams["Options"] = string.Empty; inParams["PackageLocation"] = "E:\\Softwares\\setup.exe"; ManagementBaseObject outParams = classInstance.InvokeMethod("Install", inParams, null); string retVal = outParams["ReturnValue"].ToString(); //This always returns 3
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)