Wireless Binding Order Script

J

jason.kor

I am trying to script a way that lowers the wireless binding order in
windows xp. We have LAN and wireless capabilities in our office and if
the wireless nic is set highest in the binding order it takes longer to
login into the LAN. I am working on a script that I received from
Microsoft and it seems ok, but doesn't change anything in the GUI when
I run it. I really appreciate any help or suggestions?

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 = 'Wireless
Network 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
 
D

Detlev Dreyer

I am trying to script a way that lowers the wireless binding order in
windows xp. We have LAN and wireless capabilities in our office and if
the wireless nic is set highest in the binding order it takes longer to
login into the LAN. I am working on a script that I received from
Microsoft and it seems ok, but doesn't change anything in the GUI when
I run it. I really appreciate any help or suggestions?

A good question for either
news://msnews.microsoft.com/microsoft.public.scripting.wsh or
news://msnews.microsoft.com/microsoft.public.wmi.programmer
 

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