Windows上获取已连接WiFi密码教程

复制代码保存到bat文本文件执行即可。

@echo off 
title 获取WiFi密码
echo 密码在导出的配置文件keyMaterial标签里!
echo =====================================
set /p o=要导出wlan密码配置文件至“用户目录/文档”吗? (Y / N):
if /i "%o%"=="y" goto yes
if /i "%o%"=="n" goto no
:yes
netsh wlan export profile folder = %USERPROFILE%\Documents\ key=clear
echo 已导出至"%USERPROFILE%\Documents\"目录!
pause
exit
:no
echo 极四维博客https://cway.top
netsh wlan show profile
pause
exit

更简单的脚本,直接显示 @love封尘

@echo off  & setlocal EnableDelayedExpansion
title 查看所有wifi和密码
for /f "usebackq delims=:  tokens=1-2" %%a in (`netsh wlan show profiles ^| findstr "用户配置文件"`) do (
    for /f "usebackq delims=:  tokens=1-2" %%m in (`netsh wlan show profile name^=%%b key^=clear`) do (
        echo "%%m" | findstr "关键内容" >nul && echo WIFI名称:【%%b】密码:【%%n】
    )
)
pause