WshScript.Arguments

Return command-line parameters
Syntax
WScript.Arguments

In addition to the argument itself : MyObject.item(I)you can also retrieve a count or length MyObject.Count
MyObject.Length

The default property is .item

Example
C:> cscript demo.vbs arg1 value2 33 456 "Last Arg"

[demo.vbs]
' Store the arguments in a variable:
Set objArgs = Wscript.Arguments

'Count the arguments
WScript.Echo objArgs.Count

' Display all command-line arguments
For Each strArg in objArgs
WScript.Echo strArg
Next

' Display the first 3 command-line arguments
For I = 0 to 2
Wscript.Echo objArgs(I)
Next

'Display just the third argument
Wscript.Echo objArgs(2)

'Or without the reference
WScript.Echo "The third argument is", WScript.Arguments(2)

Rule #1: Don't sweat the small stuff.
Rule #2: It's all small stuff - Dr Robert S Eliot, University of Nebraska cardiologist 

Make a Free Website with Yola.