Method:  WshCollection.Count

object.Count ()

The Count method returns a Long value which is the number of items in the collection.

The following VBScript code uses the Count method to set up a loop over the list of current network drives.

Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set clDrives = WshNetwork.EnumNetworkDrives()
For intI= 0 ToclDrives.Count - 1
    WScript.Echo clDrives.Item(intI)
Next


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

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