自动建立宽带连接+开机自动拨号.vbs
'为了减少每次重装系统后都要设置IP、建立宽带连接、设置开机自动拨号的麻烦,写了以下这VBS脚本
'(系统必须已经安装了网卡驱动才能用)
Set WS=WScript.CreateObject("WScript.Shell") WS.Run "netsh -c interface ip set address "+chr(34)+"本地连接"+chr(34)+" static 192.168.1.2 255.255.255.0 192.168.1.1 自动",0,true WS.Run "RUNDLL32 netshell.dll,StartNCW" WScript.Sleep 300 WS.AppActivate "新建连接向导" WS.SendKeys "N" WScript.Sleep 300 WS.AppActivate "新建连接向导" WS.SendKeys "N" WScript.Sleep 300 WS.AppActivate "新建连接向导" WS.SendKeys "M" WS.SendKeys "N" WScript.Sleep 300 WS.AppActivate "新建连接向导" WS.SendKeys "U" WS.SendKeys "N" WScript.Sleep 300 WS.AppActivate "新建连接向导" WS.SendKeys "%n" WS.SendKeys "%n" WS.SendKeys "{ENTER}" Set FS=WScript.Createobject("Scripting.FileSystemObject") Set OT=FS.OpenTextFile("C:\WINDOWS\宽带连接.vbs",2,true) OT.Writeline("Set WS=WScript.CreateObject("+chr(34)+"WScript.Shell"+chr(34)+")") OT.Writeline("WS.Run "+chr(34)+"Rasdial 宽带连接 帐号 密码"+chr(34)+",0") OT.Close WS.Run "C:\WINDOWS\宽带连接.vbs" WS.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\宽带连接","C:\WINDOWS\宽带连接.vbs" |
'注:红字部分根据自己的实际情况改
'这东东主要是写给自己用的,没什么技术含量^_^
建立宽带连接'其实可以加些InPutBox来做得更通用些,不过自己用的就没必要喇,呵呵^_^
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论