remote registry

riggz

New member
Joined
Aug 26, 2003
Messages
2
Im trying to get the software off a remote computer, which I have access to. Here is the code to get a list of software for a local machine.
If someone could help me with this, I would really appreciate it. Thanks in advance.


Sub InstalledSoft()
Dim Key As RegistryKey = Registry.LocalMachine.OpenSubKey _
("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", False)
Dim SubKeyNames() As String = Key.GetSubKeyNames()
Dim Index As Integer
Dim SubKey As RegistryKey

For Index = 0 To Key.SubKeyCount - 1

SubKey = Registry.LocalMachine.OpenSubKey _
("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" + "\" _
+ SubKeyNames(Index), False)

If Not SubKey.GetValue("DisplayName", "") Is "" Then
softwaredisp.text += CType(SubKey.GetValue("DisplayName", ""), String)
softwaredisp.text += CType(SubKey.GetValue("DisplayVersion", ""), String)
End If
Next

End Sub
 
Hi, you can use the OpenRemoteBaseKey as follows:

Dim RemoteReg As Microsoft.Win32.RegistryKey
RemoteReg = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "test").OpenSubKey("Software\Microsoft\Windows\CurrentVersion\", False)
Dim RemoteRegKey As String = RemoteReg.GetValue("WallPaperDir")

I hope this helps.
 
Back
Top