Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Created July 11, 2019 11:32
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joswr1ght/b4453fc2ba5f6f01e14e43978208b7fa to your computer and use it in GitHub Desktop.
Save joswr1ght/b4453fc2ba5f6f01e14e43978208b7fa to your computer and use it in GitHub Desktop.
Wi-Fi Scanning at the Windows Command Prompt, FOR loop style
FOR /L %N IN () DO @netsh wlan show networks mode=bssid | findstr "^SSID Signal" && ping -n 16 127.0.0.1 >NUL && cls
@msakazo
Copy link

msakazo commented Jun 20, 2023

please need more of cmd tricks ,esp how to search for bssid not only connected on my machine

@Hannibal52
Copy link

netsh wlan show networks
or
netsh wlan show networks mode=bssid

or ... if you are brave :

$MyWiFi = (netsh wlan show interfaces) | Select-String -Pattern "SSID" | ForEach-Object { $_.ToString().Split(":")[1].Trim() } | Select-Object -First 1

and then use the variable $MyWiFi with netsh wlan show networks mode=bssid Like this :

netsh wlan show networks mode=bssid | Select-String -Pattern "^\s*SSID\s+\d+\s+:\s+$MyWiFi$" -Context 0,10

so your script will be like this :

$MyWiFi = (netsh wlan show interfaces) | Select-String -Pattern "SSID" | ForEach-Object { $_.ToString().Split(":")[1].Trim() } | Select-Object -First 1
netsh wlan show networks mode=bssid | Select-String -Pattern "^\s*SSID\s+\d+\s+:\s+$MyWiFi$" -Context 0,10

@Hannibal52
Copy link

Hannibal52 commented Mar 10, 2024

please need more of cmd tricks ,esp how to search for bssid not only connected on my machine

this will generate a complete html file for you !

netsh wlan show wlanreport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment