在 VBscript 中使用命令行参数 [英] Using command line arguments in VBscript
本文介绍了在 VBscript 中使用命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 VBscript 中传递和访问命令行参数?
How can I pass and access command line arguments in VBscript?
推荐答案
Set args = Wscript.Arguments
For Each arg In args
Wscript.Echo arg
Next
在命令提示符下,像这样运行脚本:
From a command prompt, run the script like this:
CSCRIPT MyScript.vbs 1 2 A B "Arg with spaces"
会给出如下结果:
1
2
A
B
Arg with spaces
这篇关于在 VBscript 中使用命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文