China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 15:11
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Timed disconnect and redial. View 739 Replies 1
Original Poster Posted 2010-03-25 11:43 ·  中国 重庆 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
WScript.CreateObject("WScript.Shell").Run "iexplore http://reg.qq.com/"
WScript.Sleep 2000
Set Sh = CreateObject("WScript.Shell")
Sh.SendKeys "QQ"
Sh.SendKeys "{Tab}"
Sh.SendKeys "2008"
Sh.SendKeys "{Tab}"
Sh.SendKeys "8"
Sh.SendKeys "{Tab}"
Sh.SendKeys "8"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "aaaa" 'password
Sh.SendKeys "{Tab}"
Sh.SendKeys "aaaaa" 'password
Sh.SendKeys "{Tab}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{Tab}"

This is a VBS for applying for QQ. I was thinking that if I add a bit of code to automatically disconnect and reconnect the network, it would be perfect.
Disconnect

VBS Set ObjShell=CreateObject("Wscript.Shell")
VBS SttCommand=("cmd.exe /C rasdial /d")
VBS ObjShell.Run SttCommand, 0, False
Connect

VBS Set ObjShell=CreateObject("Wscript.Shell")
VBS SttCommand=("cmd.exe /C rasdial connection name connection account connection password")
VBS ObjShell.Run SttCommand, 0, False

Example
VBS SttCommand=("cmd.exe /C rasdial Broadband Connection 0551788888 cs245872")
The code at the top has to be run three times before the code below can be run again. If I use a variable, can I make it work? Please help, everyone.
Floor 2 Posted 2010-03-25 11:45 ·  中国 重庆 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
That is, after applying for QQ three times, it should disconnect and restart the network, and then this operation needs a delay. Can this be done at the same time?
Forum Jump: