1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| @echo off color 1f mode con: cols=100 lines=50 title WiFi密码查询 echo 正在查询结果 setlocal enabledelayedexpansion set resultFile=WiFi.txt
echo {>>%resultFile% for /f "tokens=2* delims=:" %%i in ('netsh wlan show profiles') do ( set str=%%i for /f "tokens=3* delims= " %%d in ('netsh wlan show profiles key^=clear name^="!str:~1!"^| findstr "关键内容"') do ( echo "!str:~1!"密码为:【%%d】 echo "!str:~1!":"%%d",>>%resultFile% ) ) echo }>>%resultFile%
echo 以Json格式保存在脚本所在目录的 %resultFile% 文件中 echo 任意键退出查询 pause>nul
|