So you already know netsh wlan
If you enter it, you will get a list of possible commands. One of them is add .
If you enter netsh wlan add , you get another list of possible subcommands. One of them is profile .
If you enter netsh wlan add profile , you will get a detailed explanation of all the possible options. One of the necessary parameters is an XML file containing profile information.
So how to get such an XML file? Go back to netsh wlan and learn the keywords. There is export .
If you enter netsh wlan export , you will get another list of possible subcommands. One of them is profile . It creates XML in your local directory containing the necessary information for your current WiFi connection.
If you like to enter the password in clear text, you also need to add the key=clear parameter. Make the whole team
netsh wlan export profile key=clear
Here is an example that already contains the required placeholders
<?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>{password}</keyMaterial> </sharedKey> </security> </MSM> <MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3"> <enableRandomization>false</enableRandomization> </MacRandomization> </WLANProfile>
Just replace the keywords {SSID} (occurs twice) and {password} with the desired values ββand import this file by calling
netsh wlan add profile filename="myProfile.xml"
source share