Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Searching for a registry value

$
0
0
Hey guys,

I am attempting to search through a list of registry keys held in this location: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\

The keys are different on every PC as each key is for a specific user that has, at some point, logged into the machine. In each of these keys is a string entitled "ProfileImagePath" and it holds a value such as C:\Users\Username

I need to be able to search through each key and find the key that has the string for a specific username.

The following code deletes all strings in the folder, how do I search and only delete one? I will be grateful for any help I recieve.

Code:

            Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, strComputer)

            Dim MyRegKey As Microsoft.Win32.RegistryKey

            MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion\", True)
            MyRegKey.DeleteSubKeyTree("ProfileList", True)
            MyRegKey.Close()


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>