中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-04 13:15
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 请vbs高手分析这段代码错在哪里?? 查看 684 回复 3
楼 主 请vbs高手分析这段代码错在哪里?? 发表于 2007-05-08 23:16 ·  中国 湖北 武汉 电信
中级用户
★★
scriptlover
积分 328
发帖 131
注册 2007-03-25 22:17
19年会员
UID 82910
性别 男
状态 离线
Set WshShell=CreateObject("Wscript.Shell")
Intnum=Inputbox("Please enter a number: ")
If Intnum=>6 Then
WshShell.Run "cmd.exe"
Wscript.Sleep 6000
Elseif Intnum=>1 and Intnum<6 Then
WshShell.Run "iexplorer.exe"
Wscript.End

为何运行时脚本提示最后一句缺少`end`
本人正在学习vbs,让高手见笑啦!!
scriptlover
Be with script forever!!
2 发表于 2007-05-08 23:38 ·  中国 河北 保定 联通
银牌会员
★★★
积分 1,513
发帖 554
注册 2005-12-30 00:50
20年会员
UID 48180
性别 男
状态 离线

Set WshShell=CreateObject("Wscript.Shell")
Intnum=Inputbox("Please enter a number: ")
If Intnum=>6 Then
WshShell.Run "cmd.exe"
Wscript.Sleep 6000
Elseif Intnum=>1 and Intnum<6 Then
WshShell.Run "iexplorer.exe"
End if
3 发表于 2007-05-08 23:39 ·  中国 湖北 武汉 电信
版主
★★★★★
积分 11,386
发帖 4,938
注册 2006-07-23 17:10
20年会员
UID 59080
状态 离线

Set WshShell=CreateObject("Wscript.Shell")
Intnum=Inputbox("Please enter a number: ")
If Intnum=>6 Then
WshShell.Run "cmd.exe"
Wscript.Sleep 6000
Elseif Intnum=>1 and Intnum<6 Then
WshShell.Run "iexplorer.exe"
Wscript.Quit(0)
End if

没有Wscript.End的用法。
4 发表于 2007-05-09 14:51 ·  中国 湖北 武汉 电信
中级用户
★★
scriptlover
积分 328
发帖 131
注册 2007-03-25 22:17
19年会员
UID 82910
性别 男
状态 离线
谢谢二位指教。本人实在疏忽,在vbs中if......else循环语句必须要有endif作结束标记。刚学没多久,就昏头了。哎!!!!!
scriptlover
Be with script forever!!
论坛跳转: