Results 1 to 6 of 6

Thread: Registry Key Picker (like a folder picker but for registry keys)

  1. #1

    Thread Starter
    Registered User
    Join Date
    Aug 2024
    Posts
    2

    Registry Key Picker (like a folder picker but for registry keys)

    I really want to let the user (me) visually pick a registry key to delete from the live Registry
    by browsing through the registry click a key and click an OK button then that selected Keys name/path is returned to my VB.
    Possible ?

    and then i can formulate various reg deletes that key is removed across the LAN.
    This is to remove old programs registry entries from Software/Wow64Node.

    This is like a file picker :
    Function ChooseFile (ByVal initialDir)
    Set shell = CreateObject( "WScript.Shell" )
    Set ex = shell.Exec( "mshta.exe ""about: <input type=file id=X><script>X.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(X.value);close();resizeTo (0,0);</script>""" )
    ChooseFile = Replace( ex.StdOut.ReadAll, vbCRLF, "" )
    Set ex = Nothing
    Set shell = Nothing
    End Function


    or like a folder picker :
    Function SelectFolder( myStartFolder )
    Dim objFolder, objItem, objShell
    On Error Resume Next
    SelectFolder = vbNull
    Set objShell = CreateObject( "Shell.Application" )
    Set objFolder = objShell.BrowseForFolder( 0, "Select Folder to copy", 0, "c:\" )
    If IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path
    Set objFolder = Nothing
    Set objshell = Nothing
    On Error Goto 0
    End Function

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,667

    Re: Registry Key Picker (like a folder picker but for registry keys)

    Showing us that code is a bit pointless because that's VB6. If you want to build a Registry editor then go ahead. .NET has classes specifically dedicated to Registry handling, which a bit of research would have shown you. Just be aware that .NET doesn't provide unfettered access to the Registry as a security measure. You should do some reading on the subject with the term "registry virtualization" in mind.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Registered User
    Join Date
    Aug 2024
    Posts
    2

    Re: Registry Key Picker (like a folder picker but for registry keys)

    jmcilhinney. Thanks very much that should head me in the right direction.

    I am very confused with versions of Visual Basic and how that relates to Dotnet. I generally find older is better in software so maybe I need to find a tool to work VB6.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,667

    Re: Registry Key Picker (like a folder picker but for registry keys)

    VB6 was the last version of COM-based VB and was last updated in (I think) 1998. The first version of .NET, along with VB.NET, in 2002. .NET Framework 2.0 was released in 2005 and the .NET suffix was officially dropped from VB and VS. The last version of .NET Framework was 4.8.1 and that was released some years ago. In the interim, .NET Core was released and made it to version 3.1. .NET 5 was a a merging of .NET Framework and .NET Core, built on the .NET Core codebase. All versions of VB from 2002 onwards have target the .NET platform.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,667

    Re: Registry Key Picker (like a folder picker but for registry keys)

    Note that the Registry-specific classes are part of the Microsoft.Win32 namespace.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,141

    Re: Registry Key Picker (like a folder picker but for registry keys)

    Looks more like VBS scripting code.
    With all those variables without type declaration and CreateObject calls.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width