32 or 64 bit version of product: 64bit
Operating system: Windows 10, 1803
32 or 64 bit OS: 64bit
I want to be able to click on a registration path in my Forms application and export it later.
I have tried to adapt your example, but unfortunately without success.
In the example I can only print the subkeys, but like in the picture when I click on 7zip I want to have the whole path to exactly this key. Later I want to export, import this key.
Is it possible that you give me another example, or customize your own?
Code: Select all
$formRegistrypicker_Load={
$regKey = Get-Item HKLM:\
$script:n = New-Object System.Windows.Forms.TreeNode
$n.Name = $regKey.PsPath
$n.Text = $regKey.Name
$n.Tag = $regKey
$treeview1.Nodes.Add($n)
}
$treeview1_NodeMouseClick = [System.Windows.Forms.TreeNodeMouseClickEventHandler]{
if ($_.Node.Nodes.Count -eq 0) {
foreach ($keyName in ($_.Node.Tag.GetSubkeyNames())) {
Try {
$regKey = $_.Node.Tag.OpenSubKey($keyName)
$n = New-Object System.Windows.Forms.TreeNode
$n.Name = $regKey.PsPath
$n.Text = $keyName
$n.Tag = $regKey
$_.Node.Nodes.Add($n)
} Catch {
Write-Host $_
}
}
}
# display properties...