![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Win XP WMI WSH, SetInterfaceMetric not working Guys, Here's a snippet of code I am trying to run at Logoff of the user: ' Make sure the IP address is set to automatic and that the Interface metric is set to automatic. ' Get the collection of configurations to the NIC card with the MAC address of strMACaddress colConfigs = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration where ((IPEnabled=TRUE) and (MACaddress = '" & strMACaddress & "'))") ' Let DHCP automatically assign the IP address and set the interface metric back to automatic For Each objConfig In colConfigs objConfig.EnableDHCP() intResult = objConfig.SetIPConnectionMetric(200) ' 0 means automatic? Next The NIC card is already enabled with TCP/IP protocols. The EnableDHCP method definitely works. However, the SetIPConnectionMetric method only sets the metric to the value of 1 no matter what value I use at the parameter. What's wrong with it? I also want to set it back to automatic metric. What value do I use for that, maybe zero? I tried that, and it still results with a value of 1. Second issue... Vista users are lucky in that they can use the Enable and Disable methods as well as the NetEnabled property in the Win32_NetworkAdapter class. Sadly, they are unavailable to Win XP users. What is the script work around for XP users? At least for the NetEnabled property, I can use NetConnectionStatus<>0 to show an enabled status. Thanks in advance for any help here. ... Jim .. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| windows vista restore not working/blue screen help/safe mode not working | Vista General | |||
| MS Intellipoint stopped working but ctrl panel says working proper | Vista hardware & devices | |||
| Re: Vista Internet not working, Ping by DNS is working | Vista networking & sharing | |||
| Re: Right click stops working/New tabs stop working/Menu bar disappear | Vista performance & maintenance | |||
| Creative Audigy 2 drivers working on Vista Working | Vista hardware & devices | |||