参考资料: vbs能否像其他编程语言一样,把写好的代码打包成类库以供调用呢?经过搜索和实验,发现vbs文件之间可以互相调用并共享变量,这样我们就不用再反复地编写轮子了. 以下是一个调用实例: =====1.vbs开始===== dim str str = "hello world" =====1.vbs结束===== =====2.vbs开始===== Sub include(sInstFile) Dim oFSO, f, s Set oFSO = CreateObject("
1.条件判断语句 If Then Else Sub judge(x) Then MsgBox "the num is 0" Then MsgBox "the num is 1" Then MsgBox "the num is 2" Else MsgBox "the num is other" End If End Sub judge() 2.Select case Sub sel(x) Select case x MsgBox
Sub Main Dim cnte Dim cnt Dim delay Dim time Dim onetime onetime = 9999999 delay = 5000 time = 700 For cnte = 0 To onetime crt.screen.Send "quit " & Chr(10) & chr(13) crt.Sleep delay crt.screen.Send "quit " & chr(13) crt.Sl
一.创建循环运行的run-everySecond.vbs文件[双击次文件即可启动运行] dim a set a=CreateObject("Wscript.Shell") Do ##运行xxx.exe文件,后面的0表示:不弹出运行黑窗口 a.run Wscript.Sleep Loop 注: 1.a.run "E:/xxx.exe",0 :运行xxx.exe文件,后面的0表示不弹出运行黑窗口 2.Wscript.Sleep 60000:休息60秒,即每分钟循环执行