标题: [已解决]支付宝20元,求助批处理自动连接wifi [打印本页]
作者: ageme 时间: 2019-9-29 11:11 标题: [已解决]支付宝20元,求助批处理自动连接wifi
具体报酬:20元人民币
支付方式:支付宝
联系方式:shaochen_fan@163.com
需求描述:
系统环境(windows 10 1903专业版)
已知 WiFi名为ABC 密码为abc wifi的固定DNS为 202.96.209.133
需要一个批处理文件。在一台全新的电脑上 ,让其运行后自动连接wifi 并修改固定DNS
作者: zaqmlp 时间: 2019-9-29 13:19
- @echo off
- set info=互助互利,支付宝扫码头像,感谢打赏
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
-
- set "name=ABC"
- set "password=12345678"
- set "interface=无线网络连接"
- set dns=202.96.209.133
-
- >"%tmp%\t.t" echo;s=WSH.Arguments(0),h='';for(var i=0;i^<s.length;i++){h+=s.charCodeAt(i).toString(16).toUpperCase()};WSH.echo(h)
- for /f "delims=" %%a in ('cscript -nologo -e:jscript "%tmp%\t.t" "%name%"') do set hex=%%a
-
- (echo;^<?xml version="1.0"?^>
- echo;^<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"^>
- echo; ^<name^>%name%^</name^>
- echo; ^<SSIDConfig^>
- echo; ^<SSID^>
- echo; ^<hex^>%hex%^</hex^>
- echo; ^<name^>%name%^</name^>
- echo; ^</SSID^>
- echo; ^</SSIDConfig^>
- echo; ^<connectionType^>ESS^</connectionType^>
- echo; ^<connectionMode^>auto^</connectionMode^>
- echo; ^<MSM^>
- echo; ^<security^>
- echo; ^<authEncryption^>
- echo; ^<authentication^>WPA2PSK^</authentication^>
- echo; ^<encryption^>AES^</encryption^>
- echo; ^<useOneX^>false^</useOneX^>
- echo; ^</authEncryption^>
- echo; ^<sharedKey^>
- echo; ^<keyType^>passPhrase^</keyType^>
- echo; ^<protected^>true^</protected^>
- echo; ^<keyMaterial^>01000000D08C9DDF0115D1118C7A00C04FC297EB010000002D50025A36DDCA46AFE16082AE4D313F000000000200000000001066000000010000200000007C10841B16DC100F3DA7C884C915567D98CEC783F1737A07F1EB88F905CBFE7C000000000E80000000020000200000003E4D628DAA064E41324471C609E6693692987AF5D4C3FAAA27E5213561168841100000005C4578E848EB838D38E4C37ADCB1FC6B400000005CAB2B2B8983D51B03DA671236D122F988880EDEE1A55503800E187B502FC6A8659D97B3B95AD0CD967C65034A0D574887441511F13F772C2D4173312378454D^</keyMaterial^>
- echo; ^</sharedKey^>
- echo; ^</security^>
- echo; ^</MSM^>
- echo;^</WLANProfile^>)>test.xml
-
- netsh wlan add profile filename="test.xml" interface="%interface%" user=current
- netsh wlan set profileparameter name="%name%" keyMaterial="%password%"
- netsh wlan connect name="%name%"
- netsh interface ip set dns name="%interface%" source=static addr=%dns% register=PRIMARY
- :end
- echo;%info%
- pause
复制代码
作者: ageme 时间: 2019-9-29 13:42
回复 2# zaqmlp
老哥 按照你的代码 修改了 WIFI名和password wifi能连接 但是dns无法修改
作者: zaqmlp 时间: 2019-9-29 13:49
回复 3# ageme
联系我q
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |