10

我有一个快速的问题:注册表中是否还有其他地方,但这个:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

在哪里可以找到系统的已安装应用程序?我问这个是因为例如 IExplorer 不在这些寄存器中。我还有什么地方可以看??我需要安装应用程序的所有地方。

谢谢你的帮助 ;)

4

4 回答 4

6

您最可靠的选择可能是使用 Windows 管理界面 (WMI) 来枚举 Windows Installer 安装的软件。

请参阅此处
枚举已安装的软件
Win32_Product 类

请注意,这并不能保证 Internet Explorer 会显示在那里。我认为您可以放心地假设 Internet Explorer 将出现在当前的每台 Windows 计算机上。Microsoft 将其视为操作系统的一部分。

但是,您可以找出安装了哪个版本的 IE

于 2013-05-09T00:48:18.460 回答
1

问题中的路径不包括在用户级别安装的应用程序。

它们在同一个位置,但在下面HKEY_CURRENT_USER而不是HKEY_LOCAL_MACHINE.

所以总的来说:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

但正如您所知,HKEY_CURRENT_USER仅适用于当前用户。

要访问所有用户,请访问HKEY_USERS注册表根目录,其中每个用户都有一个文件夹。

因此,您需要:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

for each user sid under HKEY_USERS:
  HKEY_USERS\<user sid>\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  HKEY_USERS\<user sid>\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

PS 如果你想匹配用户的 SID 和它的名字,你可以查找HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<user sid>key named ProfileImagePath,它应该等于C:\Users\<user name>。不是所有用户都有这个键,我认为这些是系统用户或者你不想碰的东西。

于 2020-06-23T22:43:24.077 回答
0

我一直在寻找这些信息,但过了一会儿,我记得我已经为它编写了一个程序。对每个人,或者对未来的我。

class Program
{
    //using Microsoft.Win32;
    //using System.IO;
    static void Main(string[] args)
    {
        string uninstallKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
        RegistryKey regKey = Registry.LocalMachine.OpenSubKey(uninstallKey);
        string[] subKey = regKey.GetSubKeyNames().Select((c)=>
        {
            RegistryKey rk = regKey.OpenSubKey(c);
            string displayName = (string)rk.GetValue("DisplayName");
            if (string.IsNullOrEmpty(displayName)) return "";
            return displayName + string.Format(" => [{0}]", c);
        }).ToArray<string>();
        string filename = "ProgramList.txt";
        if (File.Exists(filename)) File.Delete(filename);
        StreamWriter sw = File.CreateText(filename);
        foreach (string appName in subKey.OrderBy(c=>c))
        {
            if (appName != "" && !appName.StartsWith("{"))
            {
                Console.WriteLine(appName);
                sw.WriteLine(appName);
            }
        }
        sw.Close();
    }
}
于 2019-08-29T05:06:29.573 回答
0

#Reg.exe 在 system32 中,但如果您复制到脚本源路径,则可以使用...# reg.exe query \servername\HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

于 2021-11-05T17:49:34.433 回答