473,757 Members | 10,007 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 3057
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.LocalM achine.OpenSubK ey _
("SOFTWARE\Micr osoft\Windows\C urrentVersion\U ninstall", False)
' Retrieve a list of installed software products.
' This list also includes some software products that are not valid.
Dim SubKeyNames() As String = Key.GetSubKeyNa mes()
' 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.WriteLi ne("The following software products are installed on
this computer:")
Console.WriteLi ne("")
' 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(Ind ex) contains the name of the node that
corresponds to the
' current software product.
SubKey = Registry.LocalM achine.OpenSubK ey _
("SOFTWARE\Micr osoft\Windows\C urrentVersion\U ninstall" + "\"
_
+ SubKeyNames(Ind ex), 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 ("DisplayNam e", "") Is "" Then
' The current software product is valid.
' Display the DisplayName of this valid software product.
Console.WriteLi ne(CType(SubKey .GetValue("Disp layName", ""),
String))
End If
Next

Console.WriteLi ne("Press ENTER to quit.")
Console.ReadLin e()

End Sub

End Module

"Slimo" <sa****@tiscali .be> wrote in message
news:bt******** **@news.worldon line.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.worldon line.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.LocalM achine.OpenSubK ey _
("SOFTWARE\Micr osoft\Windows\C urrentVersion\U ninstall", False)
' Retrieve a list of installed software products.
' This list also includes some software products that are not valid. Dim SubKeyNames() As String = Key.GetSubKeyNa mes()
' 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.WriteLi ne("The following software products are installed on this computer:")
Console.WriteLi ne("")
' 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(Ind ex) contains the name of the node that
corresponds to the
' current software product.
SubKey = Registry.LocalM achine.OpenSubK ey _
("SOFTWARE\Micr osoft\Windows\C urrentVersion\U ninstall" + "\" _
+ SubKeyNames(Ind ex), 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 ("DisplayNam e", "") Is "" Then
' The current software product is valid.
' Display the DisplayName of this valid software product.
Console.WriteLi ne(CType(SubKey .GetValue("Disp layName", ""), String))
End If
Next

Console.WriteLi ne("Press ENTER to quit.")
Console.ReadLin e()

End Sub

End Module

"Slimo" <sa****@tiscali .be> wrote in message
news:bt******** **@news.worldon line.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.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP10.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.worldon line.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.LocalM achine.OpenSubK ey _
("SOFTWARE\Micr osoft\Windows\C urrentVersion\U ninstall",

False) ' Retrieve a list of installed software products.
' This list also includes some software products that are not

valid.
Dim SubKeyNames() As String = Key.GetSubKeyNa mes()
' 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.WriteLi ne("The following software products are installed

on
this computer:")
Console.WriteLi ne("")
' 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(Ind ex) contains the name of the node that
corresponds to the
' current software product.
SubKey = Registry.LocalM achine.OpenSubK ey _
("SOFTWARE\Micr osoft\Windows\C urrentVersion\U ninstall" +

"\"
_
+ SubKeyNames(Ind ex), 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 ("DisplayNam e", "") Is "" Then
' The current software product is valid.
' Display the DisplayName of this valid software product. Console.WriteLi ne(CType(SubKey .GetValue("Disp layName",

""),
String))
End If
Next

Console.WriteLi ne("Press ENTER to quit.")
Console.ReadLin e()

End Sub

End Module

"Slimo" <sa****@tiscali .be> wrote in message
news:bt******** **@news.worldon line.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
2822
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 know I can read remote registry and I can read Environment subkey, for key, current user but that value contains %UserProfile% which in turn contains %System Drive%. Is there anyway to avoid reading so many registry keys and get it the way...
3
4618
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 access the local registry bur I'd like to mount several remote registry to check a specific key for a DWORD value. Thanks, Steve
4
3575
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 attempt to Read the machines Registry remotely like so: Private Function ReadRegistryKey(ByVal strRLoc As String, _ ByVal strSubKey As String, ByVal strVal As String, _ ByVal strMachineName As String) As String Dim rKey As RegistryKey, sKey As...
4
6780
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
2300
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
1887
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 and registry information on remote machines across domains, it uses the WbemLocator.ConnectServer facility to provide specific username and password credentials. I'm trying to move this code to a vb.Net service and I'm trying to avoid the wsh...
5
6976
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 RegistryKey.OpenRemoteBaseKey(); I tried But everytime I execute it, an UnauthorizedAccessException occurred at the OpenRemoteBaseKey method. Both computer (the one that ran the C# application, and the remote computer) are Windows XP Professional,...
3
2662
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 Path) from the registry ("JKEY_CURRENT_USER\Network\") then I want to show this in list box like P: \\machine1\folder1 Z: \\mahcine2\folder2
6
3684
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 the VMware virtual machine... Right up until the application being debugged tries to write to the registry. Then it fails due to lack of security permissions. It writes to the Host PC registry just fine. This is only happening when remote...
0
10072
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.