Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Detecting Registry Values


  • Please log in to reply

#1
[YF] Daniel

[YF] Daniel

    New Member

  • Member
  • Pip
  • 5 posts
How do I read all registry keys under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"?

Then, I want to import them to a listbox

I've found a few methods to do this, but you have to know the exact key name to read it.

I am making a start up editor that looks somewhat like this:
(List Boxes)
Posted Image
  • 0

Advertisements


#2
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
This project should help you:
http://www.codeguru....tachmentid=4268

From Cimperiali at CodeGuru
  • 0

#3
[YF] Daniel

[YF] Daniel

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
Thank you, mpfeif101, that was very helpful.
01 Dim EnabledRun As Collection
02 Dim DisabledRun As Collection
03 Dim strK As Variant
04 Const E_Run_Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
05 Const D_Run_Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\HS_Disabled_Run"
06
07 Private Sub Form_Load()
08
09    Set EnabledRun = EnumRegistryValues(HKEY_LOCAL_MACHINE, E_Run_Path)
10    Set DisabledRun = EnumRegistryValues(HKEY_LOCAL_MACHINE, D_Run_Path)
11    
12    For Each strK In EnabledRun
13        For Counter = 0 To UBound(strK)
14            lstEnabled.List = strK(Counter) '<<<This isn't working
15        Next
16    Next
17
18 End Sub
So, now I am having trouble with the ListBox. See line 14.
' EnumRegistryValues - Retrieve all values under a Registry key
'Date: 4/8/2000 Updated: 7/4/2000
'Versions: VB4/32 VB5 VB6 Level: Intermediate
'Author: The VB2TheMax Team


' Enumerate values under a given registry key
'
' returns a collection, where each element of the collection
' is a 2-element array of Variants:
'    element(0) is the value name, element(1) is the value's value
What I need to do now is print the name(0) and element(1) of each value, one line per 1 name and 1 element.

I have had no experience with the "Collection" object, so I half-way know what I am doing here.

Please note that I am not a very experienced coder here, so bear with me.

Thanks in advance, Daniel.

UPDATE:
I found this
   Set RandomCrap  = EnabledRun.Item(1)
    
    MsgBox RandomCrap
I have tried making the RandomCrap object many different object types like String, Integer, and String. It just won't work...

Any Ideas?

I really stink a programming....

Edited by [YF] Daniel, 25 June 2005 - 10:24 PM.

  • 0

#4
[YF] Daniel

[YF] Daniel

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
Bump!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP