473,503 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read remote registry

Hello,

I'm searching some example of code (VB) for reading remote registry subkeys
and keys.

Thanks
Nov 18 '05 #1
3 3036
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\Uninst all", 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\Uninst all" + "\"
_
+ 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("DisplayNa me", ""),
String))
End If
Next

Console.WriteLine("Press ENTER to quit.")
Console.ReadLine()

End Sub

End Module

"Slimo" <sa****@tiscali.be> wrote in message
news:bt**********@news.worldonline.be...
Hello,

I'm searching some example of code (VB) for reading remote registry subkeys and keys.

Thanks

Nov 18 '05 #2
You need to run this code on the client. Of course the client will need the
..NET framework installed and there will be layers of security you'll have to
deal with. (I know I wouldn't want just any web site reading my registry.)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Slimo" <sa****@tiscali.be> wrote in message
news:bt**********@news.worldonline.be...
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\Uninst all", 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\Uninst all" + "\" _
+ 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("DisplayNa me", ""), String))
End If
Next

Console.WriteLine("Press ENTER to quit.")
Console.ReadLine()

End Sub

End Module

"Slimo" <sa****@tiscali.be> wrote in message
news:bt**********@news.worldonline.be...
Hello,

I'm searching some example of code (VB) for reading remote registry

subkeys
and keys.

Thanks


Nov 18 '05 #3
This is to collect data from a LAN (inventory the software installed on the
computers in an domain)

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You need to run this code on the client. Of course the client will need the .NET framework installed and there will be layers of security you'll have to deal with. (I know I wouldn't want just any web site reading my registry.)
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Slimo" <sa****@tiscali.be> wrote in message
news:bt**********@news.worldonline.be...
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\Uninst all",

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\Uninst all" +

"\"
_
+ 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("DisplayNa me",

""),
String))
End If
Next

Console.WriteLine("Press ENTER to quit.")
Console.ReadLine()

End Sub

End Module

"Slimo" <sa****@tiscali.be> wrote in message
news:bt**********@news.worldonline.be...
Hello,

I'm searching some example of code (VB) for reading remote registry

subkeys
and keys.

Thanks



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2804
by: Vinay | last post by:
Hi We can use Environment class to read %Temp% variable o local machine. But I want to read this variable for currently logged on used for remote machine. Is there anyway to do this using .NET? I...
3
4602
by: Steve Montgomery | last post by:
Does anyone have a sample block of code they can share for checking a DWORD value on a remote network machine's registry? For example, to validate a patch deployment. MSDN has a great sample for...
4
3534
by: Tim Frawley | last post by:
I am have created a reporting tool for our network to output various information we are interested in like Microsoft Office versioning information and etc. One of the things I have to do is...
4
6752
by: Chuck B | last post by:
I am modifying remote registries for about 150 computers. Is there any easy way in C# to do a remote registry backup?
3
2280
by: CAIBird | last post by:
hi, i'm wondering how to reader or write registry of a remote host. are there any classes help? Thanks in advance -Zhilin
0
1855
by: =?Utf-8?B?cGhpbC5k?= | last post by:
Hi, I've a need to use remote username and password credentials to access remote registry information via VB.net, can this be done? I've currently a vbs script that periodically accesses wmi...
5
6956
by: Sin Jeong-hun | last post by:
I need to read some registry keys of a remote computer. The key will be any key users provide. (For example : HKEY_CURRENT_USER\SOFTWARE \MyGame) I found that there was a handy method called...
3
2643
by: MSK | last post by:
Hi I am a newbie to ASP.NET and VBScript, currently I am designing a page to show all the mapped drives using client-side scripts.. I want to read all the mapped drive details (name and Remote...
6
3660
tlhintoq
by: tlhintoq | last post by:
I pride myself on being able to Google just about anything but... I have fought, tried, searched and fought some more on this one. I am using VMware, and am able to debug from Visual Studio to...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.