>?iGetUncPath("f:") > >FUNCTION iGetUncPath > >LPARAMETER tcDrive >* must be in format "c:" >tcDrive=left(alltr(tcDrive),2) >if not isalph(tcdrive) > wait wind "Usage: do ... with 'c:'" > return >endif >if len(tcdrive)=1 > tcdrive=tcdrive+":" >endif >tcdrive=left(tcdrive,2) > >DECLARE LONG WNetGetConnection IN WIN32API STRING lpszLocalName, STRING @lpszRemoteName, LONG @lSize >lpszRemoteName = SPACE(255) >lnSize = LEN(lpszRemoteName) >lnErr = WNetGetConnection(tcDrive, @lpszRemoteName, @lnSize) >IF lnErr = 0 > lcRetval = LEFT(lpszRemoteName, ATC(CHR(0),lpszRemoteName) - 1) >ELSE > lcRetval = "Error: " + STR(lnErr) >ENDIF >RETURN lcRetVal >>