本帖最后由 ArdentMan 于 2011-9-29 22:59 编辑
试写一个测试成功后保存为.vbs并将程序拖放到启动中:- Dim LanName, Name, Password, OK
- LanName = "你的宽带连接名称"
- Name = "你的宽带帐号"
- Password = "你的宽带密码"
- If Lcase(CreateObject("Wscript.Network").UserName) <> "baba" Then WScript.Quit
- If Weekday(Now(), vbMonday) <> 2 And Weekday(Now(), vbMonday) <> 4 Then
- Do
- HitLan "/disconnect" : OK = "no"
- WScript.Sleep 5000
- Loop
- Else
- Do
- If Mid(Time(), 4, Len(Time())) < "下午 08:00:00" Or Mid(Time(), 4, Len(Time())) > "下午 09:30:00" Then
- HitLan "/disconnect" : OK = "no"
- Else
- If OK <> "ok" Then
- HitLan LanName & " " & Name & " " & Password
- OK = "ok"
- End If
- End If
- WScript.Sleep 5000
- Loop
- End If
-
- Function HitLan(td)
- Dim WSSHELL
- Set WSSHELL = CreateObject("Wscript.Shell")
- WSSHELL.Run "Rasdial " & td & ">Nul 2>Nul", False, True
- Set WSSHELL = Nothing
- End Function
复制代码
|