Property:  WshCollection.length

object.length

The length property is read only and returns a Long value which is the number of items in the collection.

The following JScript code uses the length property to set up a loop over the list of current network drives.

Code:
WshNetwork = WScript.CreateObject("WScript.Network")
clDrives = WshNetwork.EnumNetworkDrives()
for (i=0; i<clDrives.length; i++)
{
    WScript.Echo(clDrives(i))
}


Output:
P:
\\FileServer\public
Q:
\\FileServer\upload

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information