且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用cmd连接到新的wifi网络

更新时间:2023-01-02 10:32:11

您需要先创建一个配置文件.最简单的方法是首先转储系统上的所有 Wi-Fi 配置文件:

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

选择此命令正在创建的 .xml 文件之一并根据您的需要进行调整.为了在配置文件中输入未加密的密码(而不是密钥材料),请将protected"设置为false"并简单地输入您的密码作为 keyMaterial,例如:

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>

当然,你还需要改变网络的SSID等等...

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

在 Microsoft 网站上查找更多信息:https://docs.microsoft.com/de-de/intune/configuration/wi-fi-profile-shared-key

Find more information on the Microsoft Website: https://docs.microsoft.com/de-de/intune/configuration/wi-fi-profile-shared-key