1. 通過命令提示符(cmd)命令連接 Wi-Fi
1.1 連接曾經連接過的 Wi-Fi
:: 查看配置的列表(::表示注釋)
netsh wlan show profile
:: 連接
netsh wlan connect ssid=你的SSID名字(簡單可以理解為Wi-Fi名) name=你的配置名字
1.2 連接從未連接過的 Wi-Fi
:: 先增加一項 Wi-Fi 配置,注意要在配置文件所在目錄執行
netsh wlan add profile filename="你的配置.xml"
:: 查看配置的列表,檢查是否添加成功
netsh wlan show profile
:: 連接
netsh wlan connect ssid=你的SSID名字 name=你的配置名字
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>你的配置名字(與SSID名字相同即可)</name>
<SSIDConfig>
<SSID>
<name>你的SSID名字</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>WPA2PSK</authentication>
<encryption>AES</encryption>
<useOneX>false</useOneX>
</authEncryption>
<sharedKey>
<keyType>passPhrase</keyType>
<protected>false</protected>
<keyMaterial>你的WiFi密碼</keyMaterial>
</sharedKey>
</security>
</MSM>
<MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
<enableRandomization>false</enableRandomization>
</MacRandomization>
</WLANProfile>
2. 查看連接過的 Wi-Fi 密碼
:: 查看特定
netsh wlan show profile 配置名稱 key=clear
:: 查看所有
for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear
3. 查看、禁用、啟用網絡接口(網卡)
:: 查看網絡接口的列表
netsh interface show interface
:: 禁用網絡接口
netsh interface set interface 接口名稱 disabled
:: 啟用網絡接口
netsh interface set interface 接口名稱 enabled