问一些关于VBS的知识

来源:百度知道 编辑:UC知道 时间:2024/05/09 14:31:49
在网上看了一个批量启动QQ的VBS脚本,有些不明白的地方.

set Wshell=CreateObject("Wscript.Shell")
是什么意思?
set 在批处理好象是设置一个变量的意思.

program="c:\Program Files\Tencent\qq\QQ.exe"
set oexec=Wshell.Exec(program)
这段第二句又是什么意思? oexec 什么函数??

wscript.Sleep 2000
wscript 是什么东西?

原文如下:;

dim program
program="c:\Program Files\Tencent\qq\QQ.exe"
rem 换成你自己的QQ路径。
set Wshell=CreateObject("Wscript.Shell")
set oexec=Wshell.Exec(program)
rem 不能用Wshell.run program来代替上一句,因为路径中有空格,会提示错误。
wscript.Sleep 2000
Wshell.SendKeys "QQ号"
wscript.Sleep 1000
Wshell.SendKeys "{TAB}"
Wshell.SendKeys "QQ密码"
wscript.Sleep 1000
Wshell.SendKeys "{ENTER}"
Wshell.SendKeys "{ENTER}"
rem 上面的双引号都不能丢。

set语句是将对象引用赋给一个变量或属性,或者将对象引用与事件关联。

oexec是变量.可以自定义.

wscript是提供对 Windows 脚本宿主对象模型根对象的访问。

建议你下载一个参考手册看看.
http://pzz.cn/soft/jb/VBS帮助手册包.rar