Dim rKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths", False)
Dim itemKey As Microsoft.Win32.RegistryKey
Dim strItems As String() = rKey.GetSubKeyNames /// get all the application name keys in the app paths section.
Dim strPath As String
For Each strPath In strItems
itemKey = rKey.OpenSubKey(strPath)
Dim appPath As String = Convert.ToString(itemKey.GetValue("")) /// default = ""
If Not appPath.Length = 0 Then
ListBox1.Items.Add(appPath) /// this is a valid exe path for an exe ( all registered exes ) thats installed on your pc
Else
appPath = Convert.ToString(itemKey.GetValue("path")) /// some files have a folder path key , but no default value.
If Not appPath.Length = 0 Then /// sometimes theres no path either here.
appPath += "\" & strPath
ListBox1.Items.Add(appPath)
End If
End If
Next