Microsoft® Windows® Script Host EnumNetworkDrives Method |
WSH Reference Version 1 |
Returns the current network drive mappings.
objDrives = object.EnumNetworkDrive
Part Description object WshNetwork object. objDrives Variable reference to the collection of drives.
Items in this collection are local names and remote names. The first item in the collection is the drive letter and the second item is the network mapping. This pattern continues for all the network drives in the collection.
The following example outputs the drive letters and network mappings:
Set WshNetwork = WScript.CreateObject("WScript.Network") Set oDrives = WshNetwork.EnumNetworkDrives For i = 0 to oDrives.Count -1 WScript.Echo oDrives.Item(i) Next