Jump to content

Activate the Network Tray Icon


Recommended Posts

Sorry , no ... USERFILESCD is the same as FILESCD, if just allows the user to point to it. I would just make a switchless self extractor that copies the files to System32. IEXPRESS and a Command Script would work. That could run from SVCPACK.INF (SVC-EXE would get it there.)

Link to comment
Share on other sites


Doesn't work in Windows XP Professional SP2: No Network Icon is displayed, and the box is still unchecked in Network Properties. It was a nice thought, anyway ...

What's this? Vindication? :P

Anyway something I forgot is that you need to specify REG_SZ as a constant equal to 1 if you decide to use the subroutine.

Link to comment
Share on other sites

  • 3 weeks later...

I am a little confused here. Does big poppa pump's winnt.sif method work or not?

[Homenet]

ShowTrayIcon = Yes

If the above does nto work, then what is the simplest method to make the 'Network Tray Icon' appear in unattended install?

Link to comment
Share on other sites

Just made a little improvement in case there is an interest. I made a subroutine to disable NetBIOS from all network interfaces. The inspiration here is a Sierra Wireless AirCard 555. When you install this card it creates two DUN entries and a NIC adapter with NetBIOS getting it's setting from DHCP. So even if you disable NetBIOS in your WINNT.SIF file, once you install this adapter (or the Cisco VPN client by the way), NetBIOS can still run if DHCP calls for it. Personally I like to ensure that NetBIOS is never enabled. It's a bandwidth waster and a huge security hole. I have noticed better throughput VPNing with the AirCard if NetBIOS is totally shutdown.

For the tray icon subroutine, I added the ability to specify the DNS suffix to the interface "Local Area Connection". Not entirely necessary, but a nice feature when working in the enterprise.

Option Explicit

Const HKLM = &H80000002

Const REG_SZ = 1

Const REG_DWORD = 4

Dim strComputer

strComputer="."

'**********************************************************************

'** Subroutine; Disable NetBIOS from all interfaces                  **

'**********************************************************************

Sub NetBTDisable

Dim objReg, strKeyPath, strNBTOptions, dwNBTOptions, arrSubKeys, SubKey, FullKey, arrEntryNames, arrValueTypes, i, dwValue

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces"

strNBTOptions = "NetbiosOptions"

dwNBTOptions = 2

objReg.EnumKey HKLM, strKeyPath, arrSubKeys

For Each SubKey In arrSubKeys

  FullKey = strKeyPath & "\" & SubKey

  objReg.EnumValues HKLM, FullKey, arrEntryNames, arrValueTypes

  For i=0 To UBound(arrEntryNames)

      Select Case arrValueTypes(i)       

      Case REG_DWORD

          objReg.GetDWORDValue HKLM, FullKey, arrEntryNames(i),dwValue

          If arrEntryNames(i) = strNBTOptions Then objReg.SetDWORDValue HKLM, FullKey, strNBTOptions, dwNBTOptions

      End Select

      Next

    Next

End Sub

'**********************************************************************

'** Subroutine; Show the tray icon for "Local Area Connection"    **

'**********************************************************************

Sub ShowNetTrayIcon

Dim objReg, strKeyPath, strKeyPath2, strShowIcon, dwShowIcon, strDomainKey, strDomain, arrSubKeys

Dim SubKey, FullKey, FullKey2, arrEntryNames, arrValueTypes, i, strValue

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}"

strKeyPath2 = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces"

strShowIcon = "ShowIcon"

strDomainKey = "Domain"

strDomain = "MyDomain.Local"

dwShowIcon = 1

objReg.EnumKey HKLM, strKeyPath, arrSubKeys

For Each SubKey In arrSubKeys

  If SubKey <> "Descriptions" Then

FullKey = strKeyPath & "\" & SubKey & "\Connection\"

FullKey2 = strKeyPath2 & "\" & SubKey

      objReg.EnumValues HKLM, FullKey, arrEntryNames, arrValueTypes

      For i=0 To UBound(arrEntryNames)

    Select Case arrValueTypes(i)       

    Case REG_SZ           

        objReg.GetStringValue HKLM, FullKey, arrEntryNames(i),strValue

        If strValue = "Local Area Connection" Then

            objReg.SetDWORDValue HKLM, FullKey, strShowIcon, dwShowIcon

            objReg.SetStringValue HKLM, FullKey2, strDomainKey, strDomain

        End If

        End Select

    Next

  End If

Next

End Sub

'**********************************************************************

'** Run tasks                                                        **

'**********************************************************************

NetBTDisable

ShowNetTrayIcon

Don't forget to change the strDomain = "MyDomain.Local" to whatever your domain is.

Link to comment
Share on other sites

  • 2 weeks later...

@RogueSpear

A VBscript line to change the name of your network connection.

ws.Run "netsh interface set interface name = ""Local Area Connection"" newname = ""My-Network""",0, True

I'm getting the following error :(

Line: 1
Char: 1
Error: Object required: 'ws'
Code: 800A01A8
Source: Microsoft VBScript runtime error

Link to comment
Share on other sites

  • 3 months later...

Not sure if youre still around here Rogue, but perhaps anyone who is familar with this vbscript could answer my question.

I was using the batch file version posted on the 1st page of this thread.. it worked like a charm... that was until I used it on my production system, that has firewire and vmware loaded on it.. It appears this batch file enables the network icon in the systray for EVERY network connections you have...

I only want it for my NIC.. not my firewire connection or my VMWare virtual adapters...

So my question.. does this script work so that it will only show my NICs?

btw.. Ive tried the winnt.sif entries for this and it doesnt work.. which of course is probably why there are these work arounds...

Thanks!!

Link to comment
Share on other sites

@durex If you notice the script looks for the network connection that is named "Local Area Connection". It should change only that one network connection, not all of them. I've run this script on literally dozens of different computers now (if not hundreds) and it has worked every time. Check and see if you changed something. As an example, I have one computer at work that has one NIC, one 802.11g adapter, VMware, Cisco VPN Client (which makes a virtual NIC), and firewire; it worked as expected and only turned on the one 10/100 NIC labeled "Local Area Connection".

Off topic - I never received an email notification that anybody responded to this thread which is odd. I just happened to search for it so I could reference it in another thread. Anyone else experience this kind of thing?

Link to comment
Share on other sites

i have another way on setting network interface parameters. after testing GreenMachines batchfile i noticed, its changing all network interfaces, even those not having any option for iconshow etc. (ms_ras..).

i made a new batch that first searches any pci-network adapter for its uniq id's and then goes the interfaces setup.

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

SET SHOWICON=0
SET IPCHECKINGENABLED=0
SET IACE=0

SET IFKEY=HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
SET CLASSKEY=HKLM\SYSTEM\CurrentControlSet\Control\Class
SET ROOTKEY=HKLM\SYSTEM\CurrentControlSet\Control\Network
SET NETWORKKEY={4D36E972-E325-11CE-BFC1-08002BE10318}

FOR /F "TOKENS=1 DELIMS= " %%A IN ('REG QUERY %CLASSKEY%\%NETWORKKEY%') DO (
   SET TEMP1=%%A
   SET TEMP2=!TEMP1:~97,4!
 
   FOR /F "TOKENS=1 DELIMS= " %%C IN ('REG QUERY %CLASSKEY%\%NETWORKKEY%\!TEMP2!') DO (    
       SET TEMP4=%%C
       rem ComponentId -> pci\ven
       SET TEMP5=!TEMP4:~0,11!
       SET TEMP6=!TEMP4:~19,7!
       IF "!TEMP5!"=="ComponentId" (
           IF "!TEMP6!"=="pci\ven" (
               FOR /F "TOKENS=1 DELIMS= " %%D IN ('REG QUERY %CLASSKEY%\%NETWORKKEY%\!TEMP2!') DO (
                  SET TEMP4=%%D
                  rem NetCfgInstanceId
                  SET TEMP5=!TEMP4:~0,16!
                  SET TEMP6=!TEMP4:~24,38!
                  IF "!TEMP5!"=="NetCfgInstanceId" (                  
                      SET FOUNDIF=!TEMP6!
                      rem ShowIcon / IpCheckingEnabled
                      SET REGSTR1=%ROOTKEY%\%NETWORKKEY%\!FOUNDIF!\Connection
                        REG ADD !REGSTR1! /v ShowIcon /t REG_DWORD /d %SHOWICON% /f
                        REG ADD !REGSTR1! /v IpCheckingEnabled /t REG_DWORD /d %IPCHECKINGENABLED% /f
                      rem IPAutoconfigurationEnabled
                      SET REGSTR2=%IFKEY%\!FOUNDIF!        
                        REG ADD !REGSTR2! /v IPAutoconfigurationEnabled /t REG_DWORD /d %IACE% /f  
                      rem add custom Ndi-settings here
                      SET REGSTR3=%CLASSKEY%\%NETWORKKEY%\!TEMP2!\Ndi
                     
                  )
               )
           )
       )
   )
)

bc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...