|
Named Arguments
This example show accessing named command line arguments.
1 | Set namedArgs = WScript.Arguments.Named |
3 | WScript.echo "Number of named arguments : " & namedArgs.length & vbCrLf |
7 | For Each argName in namedArgs |
8 | WScript.echo "Arg name : " & argName & " | Value : " & namedArgs.Item(argName) & vbCrLf |
|
cscript named_args.vbs /name:bethecoder /version:1.0 /debug:true
It gives the following output,
Number of named arguments : 3
Arg name : name | Value : bethecoder
Arg name : version | Value : 1.0
Arg name : debug | Value : true
|
|