Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. 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. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

NIC / Registry Settings

- - - - -

  • Please log in to reply
7 replies to this topic

#1
GreenMachine

GreenMachine

    ineXPlicable

  • Developer
  • 3,062 posts
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:

[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


How to remove advertisement from MSFN

#2
slartibartfast

slartibartfast

    Junior

  • Member
  • Pip
  • 69 posts
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!

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!)
Quote (http://www.uninets.n...el/whistler.htm 19.1103) :
------------------------------------------------------------------------

"Windows XP a 64 bit upgrade to a 32-bit patch for a 16-bit GUI shell running on top of an 8-bit operating system written for a 4-bit processor by a 2-bit company who cannot stand 1 bit of competition (but it's better than a Mac)!"

#3
GreenMachine

GreenMachine

    ineXPlicable

  • Developer
  • 3,062 posts
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
slartibartfast

slartibartfast

    Junior

  • Member
  • Pip
  • 69 posts
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!! :)
Quote (http://www.uninets.n...el/whistler.htm 19.1103) :
------------------------------------------------------------------------

"Windows XP a 64 bit upgrade to a 32-bit patch for a 16-bit GUI shell running on top of an 8-bit operating system written for a 4-bit processor by a 2-bit company who cannot stand 1 bit of competition (but it's better than a Mac)!"

#5
GreenMachine

GreenMachine

    ineXPlicable

  • Developer
  • 3,062 posts

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
IcemanND

IcemanND

    MSFN Junkie

  • Super Moderator
  • 3,266 posts
  • OS:Windows 7 x64
  • Country: Country Flag
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
techtype

techtype

    * Seeker of Knowledge *

  • Member
  • PipPip
  • 275 posts
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
GreenMachine

GreenMachine

    ineXPlicable

  • Developer
  • 3,062 posts
@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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN