Author Topic: IWshNetwork.EnumNetworkDrives Method  (Read 4490 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2525
  • User-Rate: +209/-0
  • Gender: Male
IWshNetwork.EnumNetworkDrives Method
« on: July 14, 2008, 08:30:41 PM »

The following code illustrates the use of the EnumNetworkDrives property:

Code: [Select]
#INCLUDE "WSHOM.INC"

DIM pWshNetwork AS IWshNetwork
DIM pDrives AS IWshCollection
DIM i AS LONG
DIM v1 AS VARIANT
DIM v2 AS VARIANT

pWshNetwork = NEWCOM "WScript.Network"
pDrives = pWshNetwork.EnumNetworkDrives
FOR i = 0 TO pDrives.Count - 1 STEP 2
   v1 = pDrives.Item(i)
   v2 = pDrives.Item(i + 1)
   STDOUT "Drive " & VARIANT$(v1) & " = " & VARIANT$(v2)
NEXT