I need to enable/disable completely network interfaces from a script in Windows XP. I\'m looking for a python solution, but any general way (eg WMI, some command-line à la n
this is VB.Net
Dim objectQuery As New ObjectQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionId IS NOT NULL")
Dim searcher As New ManagementObjectSearcher(scope, objectQuery)
Dim os As ManagementObject
Dim moColl As ManagementObjectCollection = searcher.Get()
Dim _list As String = ""
For Each os In moColl
Console.WriteLine(os("NetConnectionId"))
Next os
That will get all the interfaces on you computer. Then you can do netsh to disable it.
netsh interface set interface DISABLED