热心网友
回答时间:2024-04-20 06:34
vbs脚本中wscript对象里面有个叫Arguments的属性,可以返回参数数组
比如说你的bat文件调用vbs时是这样运行vbs的:"c:\123.vbs hello world"
那脚本应该这样写:
set argus=wscript.arguments
msgbox "此脚本一共有" & argus.count & "个参数"
if argus.count=0 then
wscript.quit '假如调用时只有路径,后面没跟着参数就退出
else
for i=0 to argus.count-1
msgbox argus(i) '把每个空格后面的参数读出来
next
end if
你试一下就懂了。。。。不懂再追问吧
收起