Home NT WSH
WshNetwork.EnumNetworkDrives

Enumerate Network Drives.

Syntax 
      WshNetwork.EnumNetworkDrives

Example

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oDrives = WshNetwork.EnumNetworkDrives

For i = 0 to oDrives.Count - 1 Step 2
   WScript.Echo "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
Next

"When we got into office, the thing that surprised me the most was that things were as bad as we'd been saying they were" - John F. Kennedy

Related commands:

NET, net use drive - WshNetwork.MapNetworkDrive
NET, remove drive map - WshNetwork.RemoveNetworkDrive

Equivalent Windows NT command:

NET - Manage network resources



Back to the Top

Simon Sheppard
SS64.com