- /*&cls&echo off&cd /d "%~dp0"
- set "ssid=YTAT-5G"
- set "password=Hzat147852"
- type "%~f0"|cscript -nologo -e:jscript "%~f0" "%ssid%" "%password%">"newwifi.xml"
- netsh wlan add profile filename="newwifi.xml"
- netsh wlan connect name="%ssid%"
- del "newwifi.xml"
- pause
- exit
- */
- var text=WSH.StdIn.ReadAll();
- var m=text.match(/\/\*\r\n([\s\S]+)\*\/\s*$/);
- WSH.echo(m[1].replace(/#ssid#/g,WSH.Arguments(0)).replace(/#password#/,WSH.Arguments(1)));
- /*
- <?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>
- */
复制代码
|