循环可以使用while ... wend:
Dim objws
Set objws=WScript.CreateObject("wscript.shell")
while true
wscript.sleep 5000
objws.RUN "1.bat"
wend
注意:上面的代码会进入死循环,即会一直运行。
do
CreateObject("wscript.shell").run "1.bat",1,true
loop
'结束1.bat后再次运行1.bat,保持打开一个1.bat窗口。
do
...........(操作)
loop
一直循环的(死循环)代码
do
Dim objws
Set objws=WScript.CreateObject("wscript.shell")
wscript.sleep 5000
objws.RUN "1.bat"
loop 一直循环
Dim A
A = FOR 1 TO 3 运行3次
Set objws=WScript.CreateObject("wscript.shell")
wscript.sleep 5000
objws.RUN "1.bat"
next