Search local computer

changobutt

Newcomer
Joined
Dec 11, 2003
Messages
23
Where can I find some samples on how to search the local computer for a certain application (if it's installed or not) in VB.NET? Do I have to make API calls, or is there an easier way to do that?

Thanks in advance!
 
Nevermind I found the code. For those that might need it, here is it. Don't forget to import Microsoft.Win32

Dim RegKey As RegistryKey
Dim sKey As String
Dim sSubKeyNames As String
Dim KeyName As RegistryKey

sKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
RegKey = Registry.LocalMachine.OpenSubKey(sKey)

For Each sSubKeyNames In RegKey.GetSubKeyNames
KeyName = RegKey.OpenSubKey(sSubKeyNames)
TextBox1.Text = TextBox1.Text & vbCrLf & KeyName.GetValue("DisplayName")
Next
 
changobutt said:
Where can I find some samples on how to search the local computer for a certain application (if it's installed or not) in VB.NET? Do I have to make API calls, or is there an easier way to do that?

Thanks in advance!
looking at your post here , the bit where you say " ( if it's installed or not ) " ...
are you talking about an application that you know will use the registry? because if you were talking about " Any " application, there's a fair chance you could find some apps which dont use the registry , so would not be found.
if it's an app that you know is gonna be in a particular section of the registry , good work :)
 
Looking at the list it returned it, it seemed to be all the application (and more) that would be listed under the "add or remove programs" from your control panel. That was exactly what I was looking for.

Thanks for your reply! :)
 
Back
Top