Microsoft® Windows® Script Host Count Property |
WSH Reference Version 1 |
Returns the number of enumerated items.
object.Count
Part Description object The result of the EnumNetworkDrive or EnumPrinterConnections methods, or the object returned by the Arguments property.
In JScript, the Count property is implemented as a method, not as a property (as it is in VBScript). Because of this, you must add a set of parentheses at the end of the statement when using Count in JScript, as in the following example:objArgs.Count()
The following example displays all command-line parameters in the Arguments collection:Set objArgs = WScript.Arguments For I = 0 to objArgs.Count - 1 WScript.Echo objArgs(I) Next