Returns an item using a zero-based index.
Parameters
-
Object
-
WshUnnamed object.
-
key
-
Associated with either a collection or a WshUnnamed object.
Remarks
Example
The following example demonstrates how the Item property can be used to return items in the WshUnnamed collection. In this example, two unnamed arguments are supplied to run a script. Inside the script, code causes the unnamed arguments to be output. The Item property is used to index into the unnamed arguments collection.
The following line is typed at the command prompt to run the script.
| Copy Code |
---|
myScript.vbs arg1 arg2 |
When the following code is executed inside the script:
| Copy Code |
---|
WScript.Echo WScript.Arguments.Unnamed.Item(0)
WScript.Echo WScript.Arguments.Unnamed.Item(1) |
the following output is produced:
| Copy Code |
---|
arg1
arg2 |
See Also