I'm hoping that there's someone here who knows VBScript and the Windows Native WiFi API. I've been using Copilot to build a cool script in VBScript. It uses the Wlan.WlanClient component to scan WiFi networks, checks the BSSIDs using the WIGLE API, and uploads the results to a server. When I try to run it with VbsEdit 32-bit or 64-bit or wscript, I get the error "ActiveX can't create component Wlan.WlanClient." It seems like I need the Managed Wifi DLL, but I can't find how to reference a DLL in VBScript. I'm hoping to disguise the file as a document, so I'd prefer not to have to use a language like VB.NET.
Code
' Create a WMI object
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
' Query the WMI object for wireless network adapters
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID = 'Wi-Fi'")
' Loop through the wireless network adapters
For Each objItem in colItems
' Get the device ID of the adapter
strDeviceID = objItem.DeviceID
' Create a Wlan client object
Set objWlan = CreateObject("Wlan.WlanClient")
' Loop through the Wlan interfaces
For Each objInterface in objWlan.Interfaces
' Check if the interface matches the device ID
If objInterface.InterfaceIndex = strDeviceID Then
' Scan for available networks
objInterface.Scan()
' Get the list of available networks
Set colNetworks = objInterface.GetAvailableNetworkList(0)
' Loop through the available networks
For Each objNetwork in colNetworks
' Print the network name (SSID)
WScript.Echo objNetwork.profileName
Next
End If
Next
Next

