复制代码保存到 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