[I would comment, but not enough rep: P] Visual Studio will let you debug VBScript so that you can determine which line in particular is causing the problem.
Change to the directory containing the script, then run 'wscript.vbs // D // X' and then select Visual Studio as the debugger. Then you can run each line and get an idea of ββwhat is happening ( source ).
When I execute this script (both with normal and elevated privileges), I get an empty array from the query "SELECT * FROM MSNDis_80211_BSSIList". This may be the problem that causes the problem; the source (MSNDis_80211_BSSIList) may be outdated and renamed to Windows 7.
Google also revealed a possible correlation between the latest set of drivers (for example, Intel Wifi drivers), which may contain WMI add-ons.
source share