VS 2010 Reading 2 Different Registry Keys / Partially Working
May 31, 2012
this works partially but if I close the reg key as shown I get an error [code]So my question is how/where do I place the Myreg.close and OldReg.Close commands???
I am trying to read keys and values from the registry. The keys I am looking for do exist in the registry, but the variable mRegKey is still Nothing after the first line is run.I have also tried different keys under HKLMSoftware, some work and some dont. HKLMSoftwareATI is found but HKLMSoftwareOracle is not (both are shown in regedit).[code]
I am writing an application that connects to a specific com port. This com port can change depending on how many physical ports are on the PC, and if other USB devices have installed com ports before this one.
I have the communication to the com port all working great, but I need to get the com port description not just the "COM#" which is all I currently get.
I found in the registry where the description is stored but am having trouble doing what I need.
there is a varied number of sub keys. The are numbered 0000-NNNN depending on how many ports you have. Inside each of these keys, there are multiple values, although I am only interested in one or 2 of them.
My problem is, that I do not know how to get a list of the subkeys (the 0000-NNNN keys/folders) from the original key I posted. I have looked through a few registry tutorials, and I can view the default value in the listed key, but I could not find how to list the subkeys of the listed key.
Does anyone have any sample code they could share that shows how I can get a listing of subkeys, and then run through those subkeys checking for a specific value in one of the strings contained in the subkey?
How can i make and read a registry key? my program creating a registry key (on the first run) and later reading it to see if it is registered or not. any suggestions on how i can manage this?
i do know it goes something like: my.computer.registry.currentuser.createsubkey, but im stuck making it and i have no clue as to where to read it...
--ThrDude--:P If it is not worth it, it is not fun - you say programmers are boring but i say they are worth it.
Trying to read a registry key that has a name and a value associated with it. However, the value name doesn't have a name, per say, but it does have a name of (Default).
Anyway, the following lines of code return a value of Nothing. Dim ReadValue As Object = My.Computer.Registry.GetValue _ ("RegKeyName", "(Default)", Nothing) 'Try to use "(Default)" for the name.
However, if I pass empty quotes, as the ValueName, it returns the correct value for the value name. I spent quite alot of time before even thinking of trying it with empty quotes.
Dim ReadValue As Object = My.Computer.Registry.GetValue _ ("RegKeyName", "", Nothing) 'Passing empty quotes for the name.
Is passing the empty quotes the correct way of getting the values from the (Default) value names? I don't want to assume this is going to work in all occasions only to get tripped up later.
I am trying to read the HKEY_USERS hive of a remote machine with this Class
Imports System.Management Imports System.Management.Instrumentation Public Enum RegHive As UInteger
[Code]....
The value of sSubKeyName is the user's SID + "" + Network (e.g. S-1-5-21-1606980848-2025429265-839522115-560021Network). Now under that key are various subkeys containing mapped drive letters. But it never returns anything.
Strangely, if I use the OpenRemoteBaseKey method it works BUT I don't want to use that because using WMI lets me specify alternate credentials and OpenRemoteBaseKey doesn't
I want to get all sub keys in a reg location. This entry can also have additional sub keys.At location "HKEY_CLASSES_ROOTexefile" this key as 3 subkeys and 2 of these keys have additional sub keys under them. I need to get all the keys and any additional sub keys under each key if there is any. This code will be used for other keys, so I can not assume they have subkeys.
Dim Key As RegistryKey = Registry.ClassesRoot.OpenSubKey("exefile", False) Dim SubKeyNames() As String = Key.GetSubKeyNames() Dim Index As Integer
I am a PC repair and networking technician in Bellingham, WA. I have been given a task regarding CD/Product keys and developing a small stand alone program that will scan and pull customer's product keys prior to reloading their OS.
ive got a small code which takes a strign given by the user, searches for all folders with in a folder for matches then lists them, which is this:
vb If e.KeyData = Keys.Return Then Dim lb1s As String = Application.StartupPath() ''The folder to search in
[Code]....
The results are added to a listbox and all works great, but how do i get it to add partial matches aswell? For example if the search string is 'testing' and theres folders called 'testing on' 'testing testing' etc to show those in the results aswell?
I'm trying to access a registry key that has a space in it, specifically:
SoftwareMicrosoftWindowsCurrentVersionWindowsU pdateAuto Update The key is valid and I believe the code is, though I can't get any keys with spaces to open using Registry.OpenSubKey
The following code fails only for keys with spaces: subkey = New String("SoftwareMicrosoftWindowsCurrentVersion WindowsUpdateAuto Update")
m_hive = m_hive.OpenSubKey(subkey, False) Dim val As Object = m_hive.GetValue(key)
I have an application where i need to enumerate the random subkeys under another registry key and then create a new registry value. The problem is I cannot figure out how to enumerate those values and then write my new values The key specifically is SystemCurrentControlSetServicesTcpipParametersInterfaces{NIC-id}where NIC-id is a subkey with random letters and numbers. However the caveat is if I can only write values under the NIC-id's that have IP addresses... if not that is fine too but I would prefer to only write the valus below under NIC cards that have IP addresses
I am working on a program that needs to fetch remote windows pc's particular registry keys and then be able to modify them (for example the Run registry key). From what I have been reading I would need to use the OpenRemoteBaseKey to do so.
What I am not sure about is how do I have the program search the network for all of the Windows computers and generate a checklist when the computer names and IP addresses are not known ?
also for the OpenRemoteBaseKey to work do I have to know the password for the administrator account for each PC ?
I have run into a brick wall here with trying to figure this out what I have is a button that when clicked on opens up the windows control panel. and then options can be set and you then close the control panel.
then there is two radio buttons one says enabled and one says disabled what they do is check the registry after the button has been clicked on and depending on if the registry is set for 0 or 2 0 for disabled 2 for enabled...
I've tried various ways but I cannot get the radio buttons to check properly
I am wondering if there is a way to get the keys from the registry and display them in a checked listbox. For example I want to get all the keys and there values from "HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun". This will allow me to see all the startup items. Is there a way that I can get all the values and display them in a checked listbox. I tried using the GetValue but it seems that you have to set the key that you want.
Find this tutorial on Dot Net SourceReason of this project:This is the next part of the previous tutorial. We'll learn here how to add, change, read, delete registry keys and values using vb.net.I included a sample that contains all those functionality.Project details:1- How to add a registry key/value2- How to read a registry value3- How to delete a key or a value4- Changing a value or a key5- Hints to use registry with VB.net6- The registry reader (VB.net)1- How to add a registry key/valueOne thing that I think I forget to notice.
I have a program which will search the entire registry for a keyword and display all the matching keys/values in a listview. The user can then select the desired keys/values and delete them. Since this a program that deals with registry, I want to give the users a way to backup the registry before they do the delete operation. I would like to know what is the best approach for this.
3 questions here: 1- Should I backup the entire registry ? 2- Should I backup only the keys/values that the user has selected in the listview ? 3 - Can I have the sample code or appropriate URL's which describes this.
I have setup my listview to View: Details I want the listview to show all the keys of a specific folder. Example: HKEY_CURRENT_USER\Software\Microsoft\VBExpress\10.0 So you click button1 and it adds all the keys within the example to your listview.
I am trying to creat a program to automate many of the things I do when I build a computer. I was attempting to do this via batch files but got stuck when I needed to search the registry for cetain keys and delete the parrent folder in which it resides in.
For instance: Installing a MS Loop Back Adapter I found a utility that works at the command promt called DEVCON that will allow me to install a MS Loop Back Adapter. I was doing this through a batch file but found that I can call the utility through VB and get the same result (of course I still need to have the DEVCON.exe)
I have an application which I am trying to implement shortcut keys in. The application contains a main window from which dialog popups can be opened. I am having difficulty implementing the shortcut key functionality on the popup windows. I have the following code in one of the popup windows, and even though the first three key entries are the exact same as on the main window (except for the actual button names), which works, the same code does not work on the popup.
Private Sub frmInduction_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Control + Keys.S Or e.KeyCode = Keys.F5 Then btnAccept.PerformClick()
[code]....
I am opening the popup window with the following code- is there any way that the problem could be caused by how I am opening the popup?
Using frm As frmChangeValue = New frmChangeValue frm.ShowDialog() End Using
I wrote this: Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown If e.KeyCode = Keys.Tab Then MsgBox("Tab") End If End Sub Why it doesn't work when I press tab on my keyboard?