本帖最后由 cainiu 于 2009-5-6 22:13 编辑
$Rs=Random(2,254,1)
ToolTip(@CR&" 正在设置网卡ip " & @CR, @DesktopWidth-260, @DesktopHeight-120)
RunWait(@ComSpec & ' /C netsh interface ip set address "本地连接" static 192.168.1.' & $Rs & ' 255.255.255.0 192.168.1.1 auto ',"", @SW_HIDE )
ToolTip(@CR&" 正在设置网络dns " & @CR, @DesktopWidth-260, @DesktopHeight-120)
RunWait(@ComSpec & ' /C netsh interface ip set dns "本地连接" static 218.85.152.99 ',"", @SW_HIDE )
ToolTip(@CR&" 正在设置网络备用dns" & @CR, @DesktopWidth-260, @DesktopHeight-120)
RunWait(@ComSpec & ' /C netsh interface ip add dns "本地连接" 218.85.157.99 ',"", @SW_HIDE )
Run("rundll32.exe netshell.dll,StartNCW")
WinWaitActive("新建连接向导")
Send("!N")
WinWaitActive("新建连接向导")
send("!N")
WinWaitActive("新建连接向导")
Send("{down}")
send("!N")
WinWaitActive("新建连接向导")
Send("{down}")
send("!N")
WinWaitActive("新建连接向导")
send("!N")
WinWaitActive("新建连接向导")
ControlSend("新建连接向导","用户名", "", "")
ControlSend("新建连接向导","密码", "", "")
ControlSend("新建连接向导","密码", "", "")
send("!N")
WinWaitActive("新建连接向导")
send("{SPACE}")
send("{enter}")
if winwait("网络配置") then
send("{enter}")
send("!{F4}")
endif
Run(@ComSpec & " /c " & 'rasphone -d 宽带连接', "", @SW_HIDE)
WinWaitActive("连接 宽带连接")
send("!s")
send("!a")
send("!u")
send("yd")
1.设置ip为192.168.2至192.168.1.254的随机ip;
2.设置dns,备用dns,各地不同,需要修改;
3.避免设置两个同样的宽带连接;
4.运行后进行宽带连接。 |