>>Thank you for the reference, which is great, especially since it shows in two different ways to accomplish job. I am giving the solution stars to Thomas Bergmann because he came in before you Sergey, not at all any less thanks to you. Lots of savvy people here.
>>
>And for completness sake, here is another code snippet that iterates thru all the drive letters:
>
>
>#Define NO_ERROR 0
>#Define ERROR_NOT_CONNECTED 2250
>
>Declare Integer GetLogicalDriveStrings In win32api;
> Integer nBufferLength, ;
> String @lpBuffer
>
>Declare Integer WNetGetConnection In mpr.Dll;
> String lpszLocalName, ;
> String @lpszRemoteName, ;
> Integer @cbRemoteName
>
>Local ;
> lcLogicalDrives As String, ;
> lnBufferLen As Integer, ;
> lnx As Integer, ;
> lcDrive As String, ;
> lcRemoteName As String, ;
> lnResult As Integer
>
>m.lnBufferLen = 128
>m.lcLogicalDrives = Space(m.lnBufferLen)
>
>m.lnBufferLen = GetLogicalDriveStrings(m.lnBufferLen, @m.lcLogicalDrives)
>
>m.lcLogicalDrives = Left(m.lcLogicalDrives, m.lnBufferLen)
>
>Clear
>
>For m.lnx = 1 To m.lnBufferLen Step 4
> m.lcDrive = Substr(m.lcLogicalDrives, m.lnx, 2)
> m.lnBufferLen = 2048
> m.lcRemoteName = Replicate(Chr(0), m.lnBufferLen)
> m.lnResult = WNetGetConnection(m.lcDrive, @m.lcRemoteName, m.lnBufferLen)
> m.lcRemoteName = Left(m.lcRemoteName, At(Chr(0), m.lcRemoteName) - 1)
> Do Case
> Case m.lnResult = NO_ERROR
>*!* We have a network drive, do stuff here
> ?m.lnResult, m.lcDrive, "Network Drive: ", m.lcRemoteName, Drivetype(m.lcDrive)
> Case m.lnResult = ERROR_NOT_CONNECTED
>*!* Not a network drive
> ?m.lnResult, m.lcDrive, "Local Drive", Drivetype(m.lcDrive)
> Otherwise
>*!* Some other error
> ?m.lnResult, m.lcDrive, "Error"
> Endcase
>Endfor
>
>
>Carlos Alloatti
Gracias, Carlos.
Alex