I am writing a program that requires the date and version information of the installation of all programs in a registry. I am able to get a list of all programs, but I do not know how to use any information about the programs. If I was able to determine the file paths located in the file path, then I would be able to use this information. I know that the programs I am interested in are all located in the This is my code: But as outlined in thread, there are its drawbacks. C: \\ Program Files (x86) \ folder, but they are in subfolders that I am unable to specify.
public list & lt; BSAApp & gt; Any ideas about how to get files to files GetInstalledApps (string computername) {list & lt; BSAApp & gt; AppList = new list & lt; BSAApp & gt; (); ManagementScope MS = New ManagementScope (); Ms.Path.Server = computerName; Ms.Path.NamespacePath = "root \\ cimv2"; Ms.Options.EnablePrivileges = True; Ms.Connect (); ManagementClass MC = New Management Class ("StdRegProv"); Mc.Scope = ms; Managementbiz object embo; Mbo = mc.GetMethodParameters ("EnumKey"); Mbo.SetPropertyValue ("sSubKeyName", "Software \\ Microsoft \\ Windows \\ CurrentVersion \" App Path); String [] Subkeys = (string []) mc.InvokeMethod ("EnumKey", Ambo, Faucet). ["SNames"] Value; if (subkey! = Null) {foreach (in subkeys in string stroke) {string path = ????? FileVersionInfo info = FileVersionInfo.GetVersionInfo (path); AppList.Add (New BSAApp Strkey, info.ProductVersion))}} return apps list;}
Management object explorers = new management object finder (" From Console.WriteLine (Mo ["name"]); Console.WriteLine (Mo ["InstallState"]);} From Win32_Product, Pre>
Comments
Post a Comment