Re: How to show ALL nearby Wi-Fi AP's BSSID every time
Marian <[email protected]>
| Newsgroups | alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
rbowman wrote:
>> This thread is seeking a solution to *that* Windows "netsh" problem.
>
> nmcli on Linux does have a 'rescan' command. Running rescan and list on
> the same machine, same location, again and again, will frequently report
> different APs with different signal strengths.
>
> Another laptop, 10' away, shows a few more although that vaires between
> rescans. A laptop 4' away shows many more than the desktop.
>
> I presume that the difference between machines is a combination of
> location and the wifi device, but that doesn't explain the difference
> between successive rescans on the same machine.
>
> If netsh is broken, so is nmcli.
Thanks for your valuable testing input, and that of others on the team.
It's an unusual problem as we're used to definitive results from commands.
Apparently querying wi-fi adapters doesn't always give definitive results.
Usually, after a few days on Usenet, a thread comes to a resolution because
a solution is generally found, but in this case I suspect there is none.
It's "good enough" that we're all aware, at least, of the inconsistencies.
I guess the tribal knowledge we all learned is that, on Windows, 'netsh
wlan show networks' doesn't always trigger a fresh scan so it more often
reports cached results tied to the last association.
That's why we are seeing various temporal inconsistencies, where it's hard
to tell without many tests whether we have the "fullest" list or not.
Linux tools like 'nmcli rescan' or 'iwlist scan' do force active scans,
but even then, those results might vary because Wi-Fi scanning is
inherently probabilistic as it's due to beacon timing, channel hopping, and
chipset filtering, such that it may very well be that we'll never be able
to be absolutely sure we obtained the "fullest" list in any set of scans.
If we want more reliable data on Windows, we might look into the
Native Wifi API or PowerShell cmdlets, which maybe can trigger scans more
directly than 'netsh' (or nmcli/iwlist) can. Dunno yet.
Looking it up, cmdlets like Get-NetAdapter and Get-NetAdapterStatistics
provide info about the NIC, but they don¢t trigger a scan themselves
<https://www.cellstream.com/2025/12/05/windows-powershell-commands-for-wi-fi-and-wlans/>
Looking it up, this "supposedly" triggers a scan on all Wi-Fi interfaces:
$wifi = New-Object -ComObject Wlanapi.WlanClient
$wifi.Interfaces | ForEach-Object { $_.Scan() }
Which, if we wait a few moments, gives netsh a "better chance" at a
more-full access point listing to be in the adapter's cache memory.
netsh wlan show networks mode=bssid
Separately I wrote up a script that disassociates the wi-fi adapter, and
then reassociates and runs a scan soon thereafter, which seems to work well
(but you never know if you have the full list so that's why I had asked).