I have my own way to do this:
#include <File.au3>
#include <Array.au3>
#NoTrayIcon
while 1
runwait(@ComSpec & ' /c for /F "tokens=1-10" %A in (''"netsh interface show interface | find /i "local""'') DO (echo %B %C %D %E %F %G) >> c:\temp\network.txt',"",@SW_HIDE)
runwait(@ComSpec & ' /c for /F "tokens=1-10" %A in (''"netsh interface show interface | find /i "wireless""'') DO (echo %B %C %D %E %F %G) >> c:\temp\network.txt',"",@SW_HIDE)
local $Network[10]
_FileReadToArray("c:\temp\network.txt",$Network)
$x = 1
$y = 1
Do
if StringInStr($Network[$x],"Local") > 0 and StringInStr($Network[$x],"Connected",1) > 0 then ;if LAN is connected disable all wifi
Do
if StringInStr($Network[$y],"Wireless") > 0 and StringInStr($Network[$y],"Connected",1) > 0 Then ; if wireless and connected
$Wireless_Name = StringReplace($Network[$y],"Connected Dedicated ","")
runwait(@ComSpec & ' /c netsh interface set interface name="'&$Wireless_Name&'" disable',"",@SW_HIDE)
EndIf
$y += 1
Until $y = $Network[0]+1
EndIf
if StringInStr($Network[$x],"Local") > 0 and StringInStr($Network[$x],"Disconnected",1) > 0 then
Do
if StringInStr($Network[$y],"Wireless") > 0 and StringInStr($Network[$y],"Disconnected",1) > 0 Then ; if wireless and disconnected
$Wireless_Name = StringReplace($Network[$y],"Disconnected Dedicated ","")
runwait(@ComSpec & ' /c netsh interface set interface name="'&$Wireless_Name&'" enable',"",@SW_HIDE)
EndIf
$y += 1
Until $y = $Network[0]+1
EndIf
$x +=1
Until $x = $Network[0]+1
runwait(@ComSpec & ' /c del c:\temp\network.txt /f',"",@SW_HIDE)
sleep(2000)
WEnd