Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script to modify Local Area Connection (HELP)

Featured Replies

I want to do the following for a Local Area Connection (under Windows XP):

- Modify the name of the connection (rename Local Area Connection to Corporate Network

- Enable the option ShowIcon (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{GUID of Adapter}\Connection\ShowIcon) ???

- Modify DNS Search List (HKLM\System\CurrentControlSet\Services\TCPIP\Parameters\SearchList) ???

- Enable NetBIOS (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcp_{GUID of Adapter}\NetbiosOptions) ???

The problem is that on the machine I want to do this there are several connections (nic, wireless, vpn) and I don't know how to find the correct entries in the registries. The connection related ones must only by applied on the nic connection (not on the other two).

My idea was to use the IP address. The script I want to use will run while the nic is connected to our LAN. So I know a part of the IP range (first to octects).

I would like to do this via VBS. After google-ling a bit a round I create the following:

Const cIPOctet_1="192"

Const cIPOctet_2="168"

Const cConnectionName="Corporate Network"

Const NETWORK_CONNECTIONS = &H31&

Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

Set colNicConfigs = oWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

Set oShell = CreateObject("Shell.Application")

Set oFolder = oShell.Namespace(NETWORK_CONNECTIONS)

For Each oNicCfg In colNicConfigs

Set oNic = oWMIService.Get("Win32_NetworkAdapter.DeviceID=" & oNicCfg.Index)

For Each vIPAddress In oNicCfg.IPAddress

aOctets = Split(vIPAddress, ".")

If aOctets(0)=cIPOctet_1 And aOctets(1)=cIPOctet_2 Then vConnectionToRename=oNic.NetConnectionID

Next

Next

If vConnectionToRename <> "" and vConnectionToRename <> cConnectionName Then

Set colItems = oFolder.Items

For Each oItem in colItems

If oItem.Name = vConnectionToRename Then oItem.Name = cConnectionName

Next

End If

Set oWMIService = Nothing

Set colNicConfigs = Nothing

Set oShell = Nothing

Set oFolder = Nothing

The first part of the scripts finds the current name of the connection via the two first octets of the IP. Once the connection name is found the second part of the script loops until the name found before is detected and then renames it to the new name. This works!

But I now want to modify

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{GUID of Adapter}\Connection\ShowIcon

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcp_{GUID of Adapter}\NetbiosOptions

But how can I detect this {GUID of Adapter} ??? I have the IP address of the connection and the connection name. Is there a way to query via VBS to find this GUID?

Can any one help? I have soon a major roll-out and need this script!

Many many thanks!

:blushing:

Take care,

Twixy

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.