![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | resetting LAN connection metric I have been using the following vbscript to reset the connection metric on my LAN. I am having problems getting it to work in Vista. Everthing seems to run correctly but the value is not reset (when I look at the properties of the Local Area Connection / properities of the TCPIP and Advanced). Also if I rerun this script the value remains the same and is not the value I am setting it to. I am running from an admin command prompt. I am guessing the addition of IPv6 may have added new variables and the setipconnectionmetric may have been renamed? Any ideas? -------------------- On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") regValueDataMetric = "35" Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Local Area Connection'") For Each objItem in colItems strMACAddress = objItem.MACAddress Wscript.Echo "MACAddress: " & strMACAddress Next Set colNetCard = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") For Each objNetCard in colNetCard If objNetCard.MACAddress = strMACAddress Then For Each strIPAddress in objNetCard.IPAddress Wscript.Echo "Description: " & objNetCard.Description Wscript.Echo "IP Address: " & strIPAddress Wscript.Echo "IPConnectionMetric: " & objNetCard.IPConnectionMetric objNetCard.SetIPConnectionMetric(regValueDataMetric) Next End If Next |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| general question re resetting/renewing IP connection | Vista networking & sharing | |||
| 3.5" x 17" lathe and chuck package, metric | .NET General | |||
| Two NICs with identical gateway metric | Vista networking & sharing | |||
| resetting LAN connection metric in VISTA | Vista General | |||
| Metric Bug in Vista for multiple DSL connections | Vista networking & sharing | |||