问题
How do I connect to a Wifi network With a command prompt,
I know that with the command
netsh wlan connect name [network name]
I can connect to an already known network. How do I connect to an unknown network by passing the password as a parameter?
回答1:
You need to create a profile first. Easiest way to do is to dump all Wi-Fi profiles on the system first:
netsh wlan export profile
Pick one of the .xml files that are being created by this command and adapt it to your needs. In order to enter an unencrypted passphrase to the profile (instead of key material), set "protected" to "false" and simple enter you passphrase as keyMaterial, e.g.:
<sharedKey>
<keyType>passPhrase</keyType>
<protected>false</protected>
<keyMaterial>12345678</keyMaterial>
</sharedKey>
Of course, you need also to change the SSID of the network, etc...
Import the profile back into the system using this command:
netsh wlan add profile myprofile.xml
Find more information on the Microsoft Website: https://docs.microsoft.com/de-de/intune/configuration/wi-fi-profile-shared-key
来源:https://stackoverflow.com/questions/60063045/connect-to-new-wifi-network-with-cmd