一键查看Win10曾经连接过的无线密码

用Win10电脑总有这样的需求

WIFI密码是啥?忘了,各种点来点去,找到了当前连接的WIFI密码。。。

那以前链接的WIFI,现在不在附近无法链接,想看密码怎么办?

so撸一段代码,一劳永逸。

一键查看Win10曾经链接过的无线密码

复制下边代码,存为.bat文件,双击运行即可。注意编码是ANSI

::  author 奕空 2019年5月28日  https://my.oschina.net/openplus/blog/3055055
netsh wlan show profile
set /p wifiName=请输入要查看密码的WIFI名:
echo %wifiName%
netsh wlan export profile name=%wifiName% folder=. key=clear
::  打开文件
::  start "" %cd%"\WLAN-%wifiName%.xml"
@echo off
for /f "tokens=*" %%i in ('findstr "<keyMaterial>.*</keyMaterial>" %cd%"\WLAN-%wifiName%.xml"')do set "s=%%i"
set "s=%s:"=“”%"
for /f "delims=<" %%j in ("%s:*<keyMaterial>=%")do set "keyMaterial=%%j"
set "keyMaterial=%keyMaterial:“”="%"
echo 您要的WIFI密码是: %keyMaterial%
pause

效果图:

转载于:https://my.oschina.net/openplus/blog/3055055

猜你喜欢

转载自blog.csdn.net/weixin_34150503/article/details/91962906