• Welcome to Theos PowerBasic Museum 2017.

IWshNetwork.EnumNetworkDrives Method

Started by José Roca, July 14, 2008, 08:30:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following code illustrates the use of the EnumNetworkDrives property:


#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