Need a script for enabling "Show icon in notification area when connected" in LAN properties

G

Guest

We push out sysprepped XP images with Ghost and have been unable to find a way to preserve the local area network connection icon in the task bar. The image has the icon set for the default user but when sysprep runs it installs new sids for the network card and the ShowIcon registry setting is not enabled. Does anyone have a script for modifying the ShowIcon setting under the current network connection?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{AE15441C-455A-4DD5-B057-C01BF6C17E41}\Connection
Your help will be greatly appreciated. Thanks in advance.
 
J

Joe

-----Original Message-----
We push out sysprepped XP images with Ghost and have
been unable to find a way to preserve the local area
network connection icon in the task bar. The image has
the icon set for the default user but when sysprep runs
it installs new sids for the network card and the
ShowIcon registry setting is not enabled. Does anyone
have a script for modifying the ShowIcon setting under
the current network connection?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Networ
k\{4D36E972-E325-11CE-BFC1-08002BE10318}\{AE15441C-455A-
4DD5-B057-C01BF6C17E41}\Connection
Your help will be greatly appreciated. Thanks in advance.
.

Save below to a .vbs file (be careful of linebreaks added
because of posting). You can use it in GUIrunonce area of
your sysprep.inf file ("cscript.exe
filepath\filename.vbs").

'****** Begin Script *********
'Author: (e-mail address removed)
'Use at your own risk.
'Enables the Notification Area icon for IP enabled
Network Connections.
'Does not rely on Network Connection name, i.e. "Local
Area Connection".
'Does modify CurrentControlSet001 as observed when
modifying via GUI (verify 1st for yourself).
'Does create registry entry if missing.

Dim objReg
Dim objWMIService
Dim colNetCards
Dim objNetCard
Dim strNICguid
Const HKLM = &H80000002
strComputer = "." 'Period = local computer
strKeyName
= "SYSTEM\CurrentControlSet\Control\Network\{4D36E972-
E325-11CE-BFC1-08002BE10318}\"
strKeyName001 = "SYSTEM\CurrentControlSet001
\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\"
dwValue = 1

On Error Resume Next

Set objReg = GetObject("winmgmts:
{impersonationLevel=impersonate}!\\" & strComputer
& "\root\default:StdRegProv")
Set objWMIService = GetObject("winmgmts:
{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery ("Select * From
Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard in colNetCards
strNICguid = objNetCard.SettingID
objReg.SetDWORDValue HKLM, strKeyName & strNICguid
& "\Connection", "ShowIcon", dwValue
objReg.SetDWORDValue HKLM, strKeyName001 & strNICguid
& "\Connection", "ShowIcon", dwValue
Next

Set objReg = Nothing
Set objWMIService = Nothing
'****** End Script *********
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top