-
Aug 5th, 2024, 10:05 PM
#1
Thread Starter
Registered User
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
-
Aug 6th, 2024, 02:02 AM
#2
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.
-
Aug 6th, 2024, 02:47 AM
#3
Thread Starter
Registered User
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.
-
Aug 6th, 2024, 09:24 AM
#4
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.
-
Aug 6th, 2024, 09:26 AM
#5
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.
-
Aug 6th, 2024, 10:06 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|