我找到了添加wifi配置文件的方式。
起初你導出現有WiFi配置:
netsh wlan export profile name="WifiNetwork" folder="C:\path\" key=clear
比你得到下面的樣式XML文件:
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>WifiNetwork</name>
<SSIDConfig>
<SSID>
<hex>123456789ABCDEF</hex>
<name>WifiNetwork</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>Password123</keyMaterial>
</sharedKey>
</security>
</MSM>
比你能修改此文件並導入它用這個命令添加這個wifi:
netsh wlan add profile filename="C:\path\WifiNetwork.xml"
檢查型材:
netsh wlan show profile
我希望我能幫助別人這一信息。