Connect to new wifi network with cmd

a 夏天 提交于 2021-01-29 14:27:51

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!