The following code read registry for the local computer; How to change it to
read registry from remote computer?
Imports Microsoft.Win32
Module Module1
Sub Main()
' Open the Uninstall registry subkey.
Dim Key As RegistryKey = Registry.LocalMachine.OpenSubKey _
("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", False)
' Retrieve a list of installed software products.
' This list also includes some software products that are not valid.
Dim SubKeyNames() As String = Key.GetSubKeyNames()
' Declare a variable to iterate through the retrieved list of
' installed software products.
Dim Index As Integer
' Declare a variable to hold the registry subkey that correspond
' to each retrieved software product.
Dim SubKey As RegistryKey
Console.WriteLine("The following software products are installed on
this computer:")
Console.WriteLine("")
' Iterate through the retrieved software products.
For Index = 0 To Key.SubKeyCount - 1
' Open the registry subkey that corresponds to the current
software product.
' SubKeyNames(Index) contains the name of the node that
corresponds to the
' current software product.
SubKey = Registry.LocalMachine.OpenSubKey _
("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" + "\"
_
+ SubKeyNames(Index), False)
' Verify that the DisplayName exists. If the DisplayName does
not exist,
' return a null string. If the returned value is a null string,
the
' DisplayName does not exist, and the software product is not
valid.
If Not SubKey.GetValue("DisplayName", "") Is "" Then
' The current software product is valid.
' Display the DisplayName of this valid software product.
Console.WriteLine(CType(SubKey.GetValue("DisplayName", ""),
String))
End If
Next
Console.WriteLine("Press ENTER to quit.")
Console.ReadLine()
End Sub
End Module