WshNetwork.EnumNetworkDrives

Enumerate Network Drives.

Syntax 
      WshNetwork.EnumNetworkDrives

Examples

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 VBScript commands

Map drive - WshNetwork.MapNetworkDrive
Remove drive map - WshNetwork.RemoveNetworkDrive
Equivalent Windows CMD command: NET - Manage network resources.
Equivalent PowerShell cmdlet: Get-PSDrive or [System.IO.DriveInfo]::GetDrives()


 
Copyright © 1999-2024 SS64.com
Some rights reserved