MSFN Forum: NIC / Registry Settings - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

NIC / Registry Settings Rate Topic: -----

#1 User is offline   GreenMachine 

  • ineXPlicable
  • Group: Developers
  • Posts: 3,062
  • Joined: 22-August 03

Posted 14 November 2003 - 09:57 AM

There are two settings that I would like to learn how to automatically configure during setup. The first is to disable the IP Autoconfiguration for my network cards, the second is to enable the system tray icon for the network connection when connected (as opposed to the default of displayed only when disconnected). The registry location for both is something like this:

Quote

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{542B20C0-013A-4B5D-A721-618470EC78CC}]"IPAutoconfigurationEnabled"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{542B20C0-013A-4B5D-A721-618470EC78CC}\Connection]
"ShowIcon"=dword:00000001
Of course the big ugly number is unique to the interface/NIC card, thus rendering a reg import impossible. Any ideas or a little C program out there?

The reason for disabling the AutoConfig is that if the DHCP is momentarily down when XP boots, it will (try to) keep it's previous IP address, instead of inventing a 169.*.*.* address. The reason for enabling the icon is that I like to have some idea of how the traffic is going.

EDIT Updated to include reg address posted below.

Thanks


#2 User is offline   slartibartfast 

  • Junior
  • Pip
  • Group: Members
  • Posts: 69
  • Joined: 06-November 03

Posted 14 November 2003 - 10:12 AM

I've just found the reg key for showing the icon but you're not going to like it! :) It's got that big long number in it!

Quote

icon enabled:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{E4B4AE4E-DDA4-459B-BA67-AAC0E7A6041D}\Connection]"PnpInstanceID"="PCI\\VEN_10EC&DEV_8139&SUBSYS_70031631&REV_10\\3&61AAA01&0&80"
"MediaSubType"=dword:00000001
"Name"="Local Area Connection"
"ShowIcon"=dword:00000001

icon disabled:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{E4B4AE4E-DDA4-459B-BA67-AAC0E7A6041D}\Connection]
"PnpInstanceID"="PCI\\VEN_10EC&DEV_8139&SUBSYS_70031631&REV_10\\3&61AAA01&0&80"
"MediaSubType"=dword:00000001
"Name"="Local Area Connection"
"ShowIcon"=dword:00000000


I don't know a way around the unique number problem, sorry (I'm still new to unattended installs!)

#3 User is offline   GreenMachine 

  • ineXPlicable
  • Group: Developers
  • Posts: 3,062
  • Joined: 22-August 03

Posted 14 November 2003 - 10:22 AM

Thanks, slartibartfast. I updated my first post to inlude that address as well. Interestingly enough, the first Ugly Number (GUID) in your post is an XP wide number - thus the same for both of us.

#4 User is offline   slartibartfast 

  • Junior
  • Pip
  • Group: Members
  • Posts: 69
  • Joined: 06-November 03

Posted 14 November 2003 - 10:34 AM

no problem, Greenmachine. How come your post didn't show the GUID?

I know it's off topic, sorry, but you seem to know what's what with these unattended cd. any chance you could give me your views on my post here:

http://www.MSFN.org/...showtopic=10911

I'm not getting any replies except for some bloke called slartibartfast who hasn't come up with any sensible suggestions!! :)

#5 User is offline   GreenMachine 

  • ineXPlicable
  • Group: Developers
  • Posts: 3,062
  • Joined: 22-August 03

Posted 14 November 2003 - 10:44 AM

slartibartfast, on Nov 14 2003, 05:34 PM, said:

I'm not getting any replies except for some bloke called slartibartfast who hasn't come up with any sensible suggestions!! :rolleyes:

I know what you mean! :)
(The first reg key has one GUID - my NIC - the second has both XPs and the NIC)
(I'll get back to you on your request ...)

#6 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 14 November 2003 - 11:08 PM

How about this? Have to reboot after running to get the icon to show in the tray.

Option Explicit

Main( )

function Main()
    DIM objShare
    DIM objEveryColl
    Dim oWSHShell
    Dim sNIC, sMan
    Dim iCount

    Set oWSHShell = WScript.CreateObject("WScript.Shell")
    set objShare = Wscript.CreateObject("HNetCfg.HNetShare.1")

    if(IsObject(objShare) = FALSE ) then
        exit function
    end if
    
    set objEveryColl = objShare.EnumEveryConnection
    
    if (IsObject(objEveryColl) = TRUE) then
    
    DIM objNetConn
    dim guid
    for each objNetConn in objEveryColl
      DIM objShareCfg
      set objShareCfg = objShare.INetSharingConfigurationForINetConnection(objNetConn)
      if (IsObject(objShareCfg) = TRUE) then
        DIM objNCProps
        set objNCProps = objShare.NetConnectionProps(objNetConn)
        if (IsObject(objNCProps) = TRUE) then
          if objNCProps.Name="Local Area Connection" then 'Change to represent the connection to change
            Guid=objNCProps.Guid
            oWSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" & guid & "\IPAutoconfigurationEnabled", 0,"REG_DWORD"
            oWSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\" & guid & "\Connection\ShowIcon", 1,"REG_DWORD"

          end if
        end if
      end if
    next
    end if
end function


#7 User is offline   techtype 

  • * Seeker of Knowledge *
  • PipPip
  • Group: Members
  • Posts: 275
  • Joined: 18-October 03

Posted 15 November 2003 - 09:08 AM

Very nice script, you do some great stuff. Your installs.vbs is real slick and answers a question that gets asked here every day!!

#8 User is offline   GreenMachine 

  • ineXPlicable
  • Group: Developers
  • Posts: 3,062
  • Joined: 22-August 03

Posted 15 November 2003 - 10:17 AM

@IcemanND: Works great for me great from the command prompt, now just have to try it in an install. ****, that's two I owe you! Might even be three, looking at that installs.vbs script techtype mentioned. And as he said, that answers a question asked repeatedly.

@slartibartfast: I was only kiddin', I didn't mean to scare you away. I PMed you a response to your question.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy