China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 05:44
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to loop to execute two commands in a VBS script, how to express goto View 1,641 Replies 3
Original Poster Posted 2006-08-20 12:43 ·  中国 浙江 宁波 电信
初级用户
★★
Credits 131
Posts 53
Joined 2006-07-31 09:06
20-year member
UID 59539
Status Offline
How to loop to execute two commands in a VBS script

:a
wscript.sleep 5000
WshShell.SendKeys "^s"
goto a

How to express :a, goto in VBS?
Floor 2 Posted 2006-08-20 14:39 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Don't be a restless person. For these basic knowledge, it is suggested that you still read the basic tutorials. The first link given at the end of "In-depth Exploration of Windows Script Technology" is "Windows Script Technology", and there will be detailed explanations in it.
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMe/CN/scd56chs.exe
The following code is an example of an infinite loop:

do
wscript.sleep 5000
WshShell.SendKeys "^s"
loop

It is still suggested that you go and read "Windows Script Technology".
Floor 3 Posted 2006-10-07 15:41 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Thanks to the moderator for providing the script learning materials~
Floor 4 Posted 2006-10-08 05:23 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
I remember that vbs doesn't seem to support goto?

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Forum Jump: