Home : Registry : Security : Forums : Software Contacts 
Scripting Guide for Windows

Scripting Guide for Windows

Part of the WinGuides Network
WinGuides Network and Software
Scripting information and resources for automated computing using Windows Script Host.
 
[Advanced Search]


Recommended Download: Registry Mechanic

Already a member? Sign in  Not a member? Register 
Recommended Download: Registry Mechanic

EnumNetworkDrives Method

Description
The EnumNetworkDrives method creates a array containing the drive letter and network path for the locally mapped drives.

object.EnumNetworkDrive

Returns a collection containing the drive letters and network paths coupled in sequential pairs. For example, the first item is the drive letter of the first mapping, the second item is the network path of the first mapping, the third item is the drive letter of the second mapping and so on.

Example

'VBScript Example
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set Drives = WshNetwork.EnumNetworkDrives

For i = 0 to Drives.Count - 1 Step 2
WScript.Echo Drives.Item(i), Drives.Item(i+1)
Next

See Also
WScript.Network ObjectMapNetworkDrive MethodRemoveNetworkDrive Method


Copyright © 2003 GuideWorks. All rights reserved. Privacy Policy:Legal Notices