中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-12 12:00
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [原创]VBS 登陆QQ。 查看 1,100 回复 2
楼 主 [原创]VBS 登陆QQ。 发表于 2010-03-31 22:59 ·  中国 广东 东莞 电信
初级用户
积分 61
发帖 39
注册 2007-03-22 16:49
19年会员
UID 82575
性别 男
来自 come from hb--wh
状态 离线
On Error Resume Next
QQLogin = "C:\Progra~1\QQ2009\Bin\QQ.exe"
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Dim QQNumber,QQPW
QQNumber = Inputbox("请输入QQ号码:","登陆QQ")
QQPW = Inputbox("请输入QQ密码", "登陆QQ")
If QQNumber = "" Or QQPW = "" Then
Msgbox "搞什么?QQ号码或密码不能为空啊,快检查下吧。", "16","通知"
Wscript.Quit
End If
MsgBox "你要登陆的QQ是:" &QQNumber,"32","通知"
Wscript.Sleep 2000
WshShell.Run QQLogin
Wscript.Sleep 2000
WshShell.Sendkeys "+{Tab}"
Wscript.Sleep 1000
WshShell.Sendkeys QQNumber
WshShell.Sendkeys "{Tab}"
Wscript.Sleep 1000
WshShell.Sendkeys QQPW
Wscript.Sleep 1000

Status = Inputbox ("请选择状态:1.我在线上,2.Q我吧,3.离开,4.忙碌,5.请勿打扰,6,隐身","状态选择")
Select Case Status
Case "1"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"
Wscript.Sleep 1000
WshShell.Sendkeys "{DOWN}"
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"

Case "2"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{DOWN}"
Wscript.Sleep 1000
WshShell.Sendkeys "{DOWN}"
Wscript.Sleep 1000
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"

Case "3"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{DOWN}"
Wscript.Sleep 1000
WshShell.Sendkeys "{DOWN}"
Wscript.Sleep 1000
WshShell.Sendkeys "{DOWN}"
Wscript.Sleep 1000
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"

Case "4"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{UP}"
Wscript.Sleep 1000
WshShell.Sendkeys "{UP}"
Wscript.Sleep 1000
WshShell.Sendkeys "{UP}"
Wscript.Sleep 1000
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"

Case "5"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{UP}"
Wscript.Sleep 1000
WshShell.Sendkeys "{UP}"
Wscript.Sleep 1000
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"

Case "6"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{UP}"
Wscript.Sleep 1000
WshShell.Sendkeys "{Enter}"
WshShell.Sendkeys "{Tab}"
WshShell.Sendkeys "{Enter}"

Case Else
Msgbox "笨蛋,出错啦!你忘了选择状态。重新来过吧。。","16","请选择状态。"
WshShell.Run "cmd.exe /c taskkill /f /im qq.exe /t",VBhide
End Select

PS: 闭来没事,学习学习VBS脚本,呵呵。。可以完美的地方高手请不吝赐教。谢谢。。
运行时请把QQLogin路径改成自己的。
本帖最近评分记录 (共 1 条) 点击查看详情
评分人分数时间
xue1995 +1 2010-04-05 11:00
2 发表于 2010-04-02 00:14 ·  中国 广东 东莞 电信
初级用户
积分 61
发帖 39
注册 2007-03-22 16:49
19年会员
UID 82575
性别 男
来自 come from hb--wh
状态 离线
郁闷。咋传不了附件。。。
3 发表于 2010-04-02 03:12 ·  美国 惠普HP
版主
★★★★★
积分 9,023
发帖 5,017
注册 2007-05-31 19:39
19年会员
UID 89899
性别 男
状态 离线
这个代码需要传附件么?
论坛跳转: