Results 1 to 4 of 4

Thread: Registry Help needed

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2008
    Posts
    101

    Registry Help needed

    Hi all i wanted to build a mac address changer tool so what im not understanding 1. how to get every NIC from the registry i now its loocated in here
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\ so how can i get all sub keys from here and read the DriverDesc name

    2. how to example select after i get the NIC name i can create a Dword key in that subdirecotry with the name Network Name example

    if somone undestand what i want to know please help sorry for my bad english and if possible comment all what you do i would like to learn from it

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Registry Help needed

    you can not change the mac address as it is hardcoded into the nic
    changing the registry setting may just stop it working
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2008
    Posts
    101

    Re: Registry Help needed

    Quote Originally Posted by westconn1
    you can not change the mac address as it is hardcoded into the nic
    changing the registry setting may just stop it working
    Yes you can its called Mac Spoffing

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Registry Help needed

    here is a scripting method to read all values (driverdesc) from the subkeys of the key you are interested in
    vb Code:
    1. Const HKEY_LOCAL_MACHINE = &H80000002
    2.  
    3. Set oreg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
    4.  
    5.  
    6. strkeypath = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"
    7. oreg.Enumkey HKEY_LOCAL_MACHINE, strkeypath, arrSubKeys, arr
    8.  
    9. For Each subkey In arrSubKeys
    10.     oreg.enumvalues HKEY_LOCAL_MACHINE, strkeypath & "\" & subkey, arrvals, aaa
    11.     If Not IsNull(arrvals) Then
    12.         For j = 0 To UBound(arrvals)
    13.             If arrvals(j) = "DriverDesc" Then
    14.                 oreg.getstringvalue HKEY_LOCAL_MACHINE, strkeypath & "\" & subkey, arrvals(j), myvalue
    15.                 MsgBox myvalue
    16.                 Exit For
    17.             End If
    18.         Next
    19.     End If
    20. Next
    21. MsgBox "finish"
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width