atabrk Posted January 20, 2007 Share Posted January 20, 2007 I want "Show icon in notification area when connected" option in connection properties to be checked as default for every connection. İs there a registery tweak for this? So i can add it to windows installation and see the connection icon on notification area. Link to comment Share on other sites More sharing options...
maxXPsoft Posted January 22, 2007 Share Posted January 22, 2007 Got this here at msfn but buried somewhere so won't even lookcan add to your runoncex to execute it. Works for meLANIconShow.cmdREM @ECHO OFFSETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONFOR /F "TOKENS=1 DELIMS= " %%A IN ('REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}') DO (SET TEMP1=%%ASET TEMP2=!TEMP1:~99,38!SET TEMP3=!TEMP2:~-1!IF "!TEMP3!"=="}" (IF NOT "!TEMP2!"=="{4D36E972-E325-11CE-BFC1-08002BE10318}" ( SET REGSTR1=HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\!TEMP2!\Connection SET REGSTR2=HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\!TEMP2! REG ADD !REGSTR1! /v ShowIcon /t REG_DWORD /d 1 /f REG ADD !REGSTR2! /v IPAutoconfigurationEnabled /t REG_DWORD /d 0 /f)))EXIT Link to comment Share on other sites More sharing options...
JuMz Posted June 20, 2007 Share Posted June 20, 2007 Wow.This worked like a charm. Thank you. Link to comment Share on other sites More sharing options...
Yzöwl Posted June 20, 2007 Share Posted June 20, 2007 It looks a little over-complicated to me! Here's a single line batch file solution@FOR /F "DELIMS=" %%? IN ('REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} /S^|FINDSTR \\Connection$') DO @REG ADD "%%?" /V ShowIcon /T REG_DWORD /D 1 /F>NUL Link to comment Share on other sites More sharing options...
war59312 Posted June 20, 2007 Share Posted June 20, 2007 (edited) Think I got you beat!!! On Error Resume Nextset ws = WScript.CreateObject("WScript.Shell")start = "HKLM\SYSTEM\CurrentControlSet"'classGUID = GUID for all Network Connection ClassclassGUID = ws.RegRead(start & "\Enum\Root\MS_NDISWANIP000\ClassGUID")'netIDxx = UID for each member of the Network Connection Class containing specific network adaptersnetID01 = ws.RegRead(start & "\Control\Class\" & classGUID & "001\NetCfgInstanceID")netID02 = ws.RegRead(start & "\Control\Class\" & classGUID & "002\NetCfgInstanceID")netID03 = ws.RegRead(start & "\Control\Class\" & classGUID & "003\NetCfgInstanceID")netID04 = ws.RegRead(start & "\Control\Class\" & classGUID & "004\NetCfgInstanceID")netID05 = ws.RegRead(start & "\Control\Class\" & classGUID & "005\NetCfgInstanceID")netID06 = ws.RegRead(start & "\Control\Class\" & classGUID & "006\NetCfgInstanceID")netID07 = ws.RegRead(start & "\Control\Class\" & classGUID & "007\NetCfgInstanceID")netID08 = ws.RegRead(start & "\Control\Class\" & classGUID & "008\NetCfgInstanceID")netID09 = ws.RegRead(start & "\Control\Class\" & classGUID & "009\NetCfgInstanceID")netID10 = ws.RegRead(start & "\Control\Class\" & classGUID & "010\NetCfgInstanceID")netID11 = ws.RegRead(start & "\Control\Class\" & classGUID & "011\NetCfgInstanceID")netID12 = ws.RegRead(start & "\Control\Class\" & classGUID & "012\NetCfgInstanceID")netID13 = ws.RegRead(start & "\Control\Class\" & classGUID & "013\NetCfgInstanceID")netID14 = ws.RegRead(start & "\Control\Class\" & classGUID & "014\NetCfgInstanceID")' setIcon recieves location of current network connections and also flag (1) to turn on showIconssetIcon start & "\Control\Network\" & classGUID & "\" & netID01 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID02 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID03 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID04 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID05 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID06 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID07 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID08 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID09 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID10 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID11 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID12 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID13 & "\Connection\", 1setIcon start & "\Control\Network\" & classGUID & "\" & netID14 & "\Connection\", 1'MsgBox "Show icon in Notification Area when connected is set.", 4096,"Finished"'********************************************************' Subroutine setIcon(nicID as String, flag as Binary)' strName = Registry Value of "Name" in Current nicID. Network connections with Icons also contain a "Name" Registry setting ' Will not effect 1394 Connection through string comparison with strName' flag is used to turn to set ShowIcon registry settingSub setIcon(nicID,flag)strName = ws.RegRead( nicID & "Name")If strName = "" Thenelse if InStr(strName, "1394") = 0 then' MsgBox strName ws.RegWrite nicID & "ShowIcon", flag, "REG_DWORD" end ifend ifEnd Sub Edited June 20, 2007 by war59312 Link to comment Share on other sites More sharing options...
waleed_wwn Posted June 20, 2007 Share Posted June 20, 2007 @Yzöwl Thank you so much for the Batch file ,This worked like a charm. Perfect Link to comment Share on other sites More sharing options...
artbio Posted October 26, 2008 Share Posted October 26, 2008 This is my AutoIt script:#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Language: English Platform: Windows XP Author: artbio Script Function: Show icon in notification area when connected.#ce ----------------------------------------------------------------------------#NoTrayIcon#include <Misc.au3>_Singleton("Network Icon AutoIt v3 Script 1.0", 0); It's already runningDim Const $sKey = "HKLM\SYSTEM\CurrentControlSet\Control\Network"Dim $kWhile 1 $k += 1 $sSubKey0 = RegEnumKey($sKey, $k) If @error Then ExitLoop $sDefault = RegRead($sKey & "\" & $sSubKey0, "") $sClass = RegRead($sKey & "\" & $sSubKey0, "Class") If $sDefault = "Network Adapters" And $sClass = "Net" Then ExitLoopWEnd$k = 0While 1 $k += 1 $sSubKey1 = RegEnumKey($sKey & "\" & $sSubKey0, $k) If @error Then ExitLoop If RegRead($sKey & "\" & $sSubKey0 & "\" & $sSubKey1 & "\Connection", "Name") = "Local Area Connection" Then ExitLoopWEndIf Not @error Then RegWrite($sKey & "\" & $sSubKey0 & "\" & $sSubKey1 & "\Connection", "ShowIcon", "REG_DWORD", 1)ExitRegards. Link to comment Share on other sites More sharing options...
artbio Posted October 27, 2008 Share Posted October 27, 2008 Here is the other AutoIt function I did for the same purpose:#include-once; #FUNCTION# ====================================================================================================================;; Name...........: _Network_SetIcon; Description ...: Shows or hides the network icon in notification area when connected.; Syntax.........: _Network_SetIcon($sNetConnectionID [, $iFlag, $sComputerName]); Parameters ....: $sNetConnectionID - Name of the network connection.; $iFlag - [Optional] A flag indicating the behaviour of the network icon:; 0 - Icon in notification area when connected remains hidden.; 1 - Icon in notification area when connected is shown.; Default is "1".; $sComputerName - [Optional] Computer name.; The local computer is default.; Return values .: Success - Returns 1; Failure - Returns 0 and sets @error:; Author ........: artbio; Modified.......:; Remarks .......:; Related .......:; Link ..........;; Example .......;;; ===============================================================================================================================Func _Network_SetIcon($sNetConnectionID, $iFlag = 1, $sComputerName = @ComputerName) Local Const $sKey = "\\" & $sComputerName & "\HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\" Local $objWMIService, $colAdapters, $colAdaptersConfig, $iRet $objWMIService = ObjGet("winmgmts:{ImpersonationLevel=impersonate}!\\" & $sComputerName & "\root\CIMV2") $colAdapters = $objWMIService.ExecQuery('Select * from Win32_NetworkAdapter Where NetConnectionID = "' & $sNetConnectionID & '"') For $objAdapter In $colAdapters $colAdaptersConfig = $objWMIService.ExecQuery('Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True And MACAddress = "' & $objAdapter.MACAddress & '"') For $objAdapterConfig In $colAdaptersConfig $iRet = RegWrite($sKey & $objAdapterConfig.SettingID & "\Connection", "ShowIcon", "REG_DWORD", $iFlag) Next Next Return SetError($iRet = 0, 0, $iRet)EndFunc;==> _Network_SetIconRegards. Link to comment Share on other sites More sharing options...
artbio Posted October 27, 2008 Share Posted October 27, 2008 This is an improved version:#include-once; #FUNCTION# ======================================================================================================================================================================;; Name...........: _Network_SetIcon; Description ...: Shows or hides the network icon in notification area when connected.; Syntax.........: _Network_SetIcon($sNetConnectionID [, $iFlag, $sComputerName]); Parameters ....: $sNetConnectionID - Name of the network connection.; $iFlag - [Optional] A flag indicating the behaviour of the network icon:; 0 - Icon in notification area when connected remains hidden.; 1 - Icon in notification area when connected is shown.; Default is "1".; $sComputerName - [Optional] Computer name.; The local computer is default.; Return values .: Success - Returns 1; Failure - Returns 0 and sets @error:; Author ........: artbio; Modified.......:; Remarks .......:; Related .......:; Link ..........;; Example .......;;; =================================================================================================================================================================================Func _Network_SetIcon($sNetConnectionID, $iFlag = 1, $sComputerName = @ComputerName) Local Const $sRootKey = "\\" & $sComputerName & "\HKLM\SYSTEM\CurrentControlSet\" Local $objWMIService, $colWAN, $sClassGUID, $colAdapters, $colConfig, $iRet = 0 $objWMIService = ObjGet("winmgmts:{ImpersonationLevel=impersonate}!\\" & $sComputerName & "\root\CIMV2") $colWAN = $objWMIService.ExecQuery('Select * from Win32_NetworkAdapter Where Name = "WAN Miniport (IP)"') For $objWAN In $colWAN $sClassGUID = RegRead($sRootKey & "Enum\" & $objWAN.PNPDeviceID, "ClassGUID") If Not @error Then $colAdapters = $objWMIService.ExecQuery('Select * from Win32_NetworkAdapter Where NetConnectionID = "' & $sNetConnectionID & '"') For $objAdapter In $colAdapters $colConfig = $objWMIService.ExecQuery('Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True And MACAddress = "' & $objAdapter.MACAddress & '"') For $objConfig In $colConfig $iRet = RegWrite($sRootKey & "Control\Network\" & $sClassGUID & "\" & $objConfig.SettingID & "\Connection", "ShowIcon", "REG_DWORD", $iFlag) Next Next EndIf Next Return SetError($iRet = 0, 0, $iRet)EndFunc;==> _Network_SetIcon Link to comment Share on other sites More sharing options...
Oxygen Posted January 30, 2010 Share Posted January 30, 2010 (edited) It looks a little over-complicated to me! Here's a single line batch file solution@FOR /F "DELIMS=" %%? IN ('REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} /S^|FINDSTR \\Connection$') DO @REG ADD "%%?" /V ShowIcon /T REG_DWORD /D 1 /F>NULthank u so much , worked great with me and also very simple Edited January 30, 2010 by Oxygen Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now