[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$form = New-Object System.Windows.Forms.Form
$form.Size = New-Object System.Drawing.Size(500,300)
$form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen
$label = New-Object System.Windows.Forms.Label
$label.Text = "Click the button to view the ProfileList registry in regedit"
$label.Size = New-Object System.Drawing.Size(300,30)
$label.Location = New-Object System.Drawing.Point(100,50)
$display_button = New-Object System.Windows.Forms.Button
$display_button.Text = "Display ProfileList"
$display_button.Size = New-Object System.Drawing.Size(150,30)
$display_button.Location = New-Object System.Drawing.Point(175,100)
$display_button.Add_Click({
regedit "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
})
$form.Controls.Add($label)
$form.Controls.Add($display_button)
$form.ShowDialog()
Upon running the script I receive the following error: "Error opening the file"
I am not sure if the path is correct, can someone point out what I'm doing wrong?
regedittells the program to open what it expects is a file in.regformat and import the data into the registry. It does not open the registry with that key in view.