- @echo off
- (for /f "delims=" %%a in (%~fs0) do (
- if "%%a"=="<?xml version="1.0"?>" set f=1
- if defined f echo;%%a
- ))>"%~fs0.xml"
- netsh wlan add profile filename="%~fs0.xml"
- netsh wlan connect name="无线名CMCC-10086"
- del "%~fs0.xml"
- pause
- goto :eof
-
-
- <?xml version="1.0"?>
- <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
- <name>MY_NETWORK_SSID</name>
- <SSIDConfig>
- <SSID>
- <name>无线名CMCC-10086</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>密码</keyMaterial>
- </sharedKey>
- </security>
- </MSM>
- <MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
- <enableRandomization>false</enableRandomization>
- </MacRandomization>
- </WLANProfile>
复制代码
|