以下查询指令在Win10下测试通过
1个for.简单版:SSID—“无”空格等特殊字符- for /f "skip=10 tokens=1,2 delims=:" %a in ('netsh wlan show profiles') do@netsh wlan show profiles %b key=clear
复制代码 2个for.完整版:SSID—“含”空格等特殊字符- for /f "skip=10 tokens=1,2 delims=:" %a in ('netsh wlan show profiles') do @for /f "tokens=*" %c in ("%b") do @netsh wlan show profiles "%c" key=clear
复制代码 3个for.优化版- for /f "skip=10 tokens=1* delims=:" %a in ('netsh wlan show profiles') do @for /f "tokens=*" %c in ("%b") do @for /f "tokens=1* delims=:" %d in ('netsh wlan show profiles "%c" key^=clear^|findstr /r "关键内容"') do @echo;&@echo;SSID: %c 密码:%e
复制代码
|