我想找出我所有 wlan 的名稱及其密碼:
ssid : password
通過我所做的搜索,我意識到可以使用 netsh 單獨提取密碼但是我需要一個批處理腳本來獲取每個 wlan 的名稱,并提取并顯示每個名稱的密碼例如,我希望輸出為像這樣:
ModemN1 : 123987654af
IsntModem : PASSw0rd!23
如果你有除了netsh之外的其他解決方案,請告訴我
可以找到所有的 wlan 組態檔:
C:> netsh wlan show profile
Profiles on interface Wi-Fi:
Group policy profiles (read only)
---------------------------------
<None>
User profiles
-------------
All User Profile : ModemN1
All User Profile : IsntModem
它應該在此處提取兩個ModemN1,IsntModem字串 對于這些字串中的每一個,將字串放入此命令中:
netsh wlan show profile <WLAN_NAME> key=clear
C:> netsh wlan show profile IsntModem key=clear
Profile IsntModem on interface Wi-Fi:
=======================================================================
Applied: All User Profile
Profile information
-------------------
Version : 1
Type : Wireless LAN
Name : IsntModem
Control options :
Connection mode : Connect automatically
Network broadcast : Connect even if this network is not broadcasting
AutoSwitch : Do not switch to other networks
MAC Randomization : Disabled
Connectivity settings
---------------------
Number of SSIDs : 1
SSID name : "IsntModem"
Network type : Infrastructure
Radio type : [ Any Radio Type ]
Vendor extension : Not present
Security settings
-----------------
Authentication : WPA2-Personal
Cipher : CCMP
Authentication : WPA2-Personal
Cipher : GCMP
Security key : Present
Key Content : PASSw0rd!23
Cost settings
-------------
Cost : Unrestricted
Congested : No
Approaching Data Limit : No
Over Data Limit : No
Roaming : No
Cost Source : Default
并從這里提取密碼
謝謝你幫助我?
uj5u.com熱心網友回復:
我敢肯定這已經被決議過雖然找不到電源外殼復制它,您可以嘗試一下,似乎效果很好:
netsh wlan show profile | Select-String '(?<=All User Profile\s :\s). ' | ForEach-Object {
$wlan = $_.Matches.Value
$passw = netsh wlan show profile $wlan key=clear | Select-String '(?<=Key Content\s :\s). '
[pscustomobject]@{
Name = $wlan
Password = $passw.Matches.Value
}
}
對于正則運算式描述:
- https://regex101.com/r/v9T4pB/2第一個
- https://regex101.com/r/xPeEDy/2第二個
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/515744.html
