Getting the list of installed programs on the local machine
Tuesday, September 23, 2003 at 11:27PM Here's a snippet from the win-tech-off-topic list:
Getting the list of installed programs on the local machine:
static void GetInstalled()
{
string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
foreach (string skName in rk.GetSubKeyNames())
{
using (RegistryKey sk = rk.OpenSubKey(skName))
{
Console.WriteLine(sk.GetValue("DisplayName"));
}
}
}
}





Reader Comments (1)
RegistryKey requires use of Microsoft.Win32 namespace.