2 Attachment(s)
[RESOLVED] Read Startup Program In Regsity and Put in ListView
I'm trying trying to add a feature to a program i'm working on that puts the start up programs on a system into a listview.
The start up items are stored in the following registry location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
What I would like to do is read the Program Name value under the Name Column in the registry and the Data Value under the Data value and put these values into the listview in two seperate columns like Msconfig utility see the screen shot.
I'm familiar with working with the registry in .NET, but I can't seem to get this to work. I believe I would need to loop through each registyvaluename under this key and get the name and value.
Thanks,
1 Attachment(s)
Re: Read Startup Program In Regsity and Put in ListView
This is what I get with the console.writeline this is essentially the information i'm trying to list in a listview.
Re: Read Startup Program In Regsity and Put in ListView
Using a DataGridView
Code:
Private Sub PopulateRegDemo()
Dim dt As New DataTable
dt.Columns.AddRange(New DataColumn() _
{ _
New DataColumn("StartUpItem", GetType(System.String)), _
New DataColumn("RunCommand", GetType(System.String)) _
} _
)
Dim regKey As Microsoft.Win32.RegistryKey
regKey = Microsoft.Win32.Registry.LocalMachine _
.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", False)
Dim Names = regKey.GetValueNames
For Each Item In Names
dt.Rows.Add(New Object() {Item, regKey.GetValue(Item).ToString.Replace(Chr(34), "")})
Next
regKey.Close()
dt.DefaultView.Sort = "StartUpItem"
DataGridView1.DataSource = dt.DefaultView
End Sub
Re: Read Startup Program In Regsity and Put in ListView
Thanks for you help! I figured out how to list the items in a listview as well. My msconfig like utility is almost complete! :wave:
Thanks!
Re: [RESOLVED] Read Startup Program In Regsity and Put in ListView
Good to hear you are making head way. It would be intersting to know why this thread recieved a one star rating as this indicates a Terrible thread.
Re: [RESOLVED] Read Startup Program In Regsity and Put in ListView
Not sure i just rated 5 stars.
Quote:
Originally Posted by
kevininstructor
Good to hear you are making head way. It would be intersting to know why this thread recieved a one star rating as this indicates a Terrible thread.