用Win10電腦總有這樣的需求bash
WIFI密碼是啥?忘了,各類點來點去,找到了當前鏈接的WIFI密碼。。。編碼
那之前連接的WIFI,如今不在附近沒法連接,想看密碼怎麼辦?spa
so擼一段代碼,一勞永逸。.net
一鍵查看Win10曾經連接過的無線密碼code
複製下邊代碼,存爲.bat文件,雙擊運行便可。注意編碼是ANSIxml
:: 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
效果圖:blog