初学VBS,想让各位看看我错在那了。谢谢啊

来源:百度知道 编辑:UC知道 时间:2024/05/16 06:29:26
dim strq
strq = "D:Program Files\Tencent\QQ\QQ.exe"
set wshshell = createobject("wscript.shell")
wshshell.exec (strq)
wscript.sleep 5000
wshshell.sendkeys "{tab}"
wshshell.sendkeys "529974596"
wshshell.sendkeys "{tab}"
wshshell.sendkeys "1305281990liruo"
wscript.sleep 1000
wshshell.sendkeys "{enter}"

好象没什么错...
运行后5秒输入帐号和密码
以下代码,在QQ2008和QQ2007都试过,完全正常
dim strq
set wshshell = createobject("wscript.shell")
strq = wshshell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\TENCENT\QQ\Install") & "qq.exe"
wshshell.exec strq
wscript.sleep 2000
wshshell.sendkeys "{tab}"
wshshell.sendkeys "529974596"
wshshell.sendkeys "{tab}"
wshshell.sendkeys "1305281990liruo"
wscript.sleep 500
wshshell.sendkeys "{enter}"