DECLARE INTEGER WNetGetConnection IN Win32API; STRING @lpszLocalName, STRING @lpbuffer, INTEGER @lnbufsize lcdrive = "F:" lnsize = 260 lcbuffer = SPACE(lnsize) = WNetGetConnection(@lcdrive, @lcbuffer, @lnsize) ? LEFT(lcbuffer, lnsize - 1)Naturally, you should check for the presence of the drive prior to issuing the calls. You can do this via the DRIVETYPE() function.
oNet = CREATEOBJECT("WScript.Network") oDrives = oNet.EnumNetworkDrives FOR lni = 1 TO oDrives.Count - 1 STEP 2 ? oDrives.Item(lni) && Display the share name NEXTThe WSH, BTW, can also be used to map the drives for you. For details, see last December's issue of the VFUG newsletter. It's the fourth of a five part series that Ed Rauh and I wrote on the WSH. It's available on-line at www.vfug.org.