windows下Wifi信号获取的批处理
@echo off
setlocal enabledelayedexpansion
:Main
call :GetWifiNum || exit /b 1
exit /b 0
:GetWifiNum
set "ssidnum=0"
for /f %%i in ('netsh wlan show all ^|grep -i "signal" ^|awk -F ":" "{print $2}" ^|tr -d "%%"') do (
if "%%i" GTR "85" (
set /a ssidnum=!ssidnum!+1
)
)
echo ===============================================================
echo The numbers of WIFI Signal strength greater than 85%: !ssidnum!
echo ===============================================================
if !ssidnum! GEQ 3 (
exit /b 0
) else (
exit /b 1
)
goto :eof
以上批处理输出信号强度大于85的Wifi个数~
|