troubleshooting Question

How to read registry String Names under a Subkey

Avatar of yo_bee
yo_beeFlag for United States of America asked on
Visual Basic Classic.NET ProgrammingSystem Utilities
5 Comments1 Solution812 ViewsLast Modified:
I am writing a very basic VB form that populates a combobox with all active computers in our Domain. Once The Computer is selected I want to purge a String from a subkey
I was able to get the string value of a certian StringName using the "GETSTRINGVALUE".
The ultimate goal it to list all the String Names under the key.



Private Sub reg_read()
        Dim oConn As ConnectionOptions = New ConnectionOptions()
        Dim scope = New ManagementScope("\\" & ComboBox1.Text & "\root\default")
        Dim registry As ManagementClass = New ManagementClass(scope, New ManagementPath("StdRegProv"), Nothing)
        Dim inParams As ManagementBaseObject = registry.GetMethodParameters("EnumValues")
        inParams("hDefKey") = 2147483650
        inParams("sSubKeyName") = "SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\"
        Dim outParams As ManagementBaseObject = registry.InvokeMethod("EnumValues", inParams, Nothing)
        ListBox1.Items.Add(outParams("sValueName"))
    End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros