clear lcdrive=LEFT(sys(16),2) lcunc=getuncname(lcdrive) ?lcunc * or an example where driver K: is the one I want: lcdrive='K:' lcunc=getuncname(lcdrive) ? lcunc return FUNCTION getuncname PARAMETERS lcdrive *lcdrive typically is c: or k: or Y:, etc. lcunc=getunc(lcdrive) IF !EMPTY(lcunc) .and. "\\" $ lcunc * Strip out the share name lcunc=SUBSTR(lcunc,(AT('\\',lcunc)+2),AT('\',lcunc,3)-(AT('\\',lcunc)+2)) ENDIF ?lcunc return lcunc FUNCTION GetUNC LPARAMETER cDriveLetterToCheck LOCAL cBuffer, nResult, lcUnc IF TYPE('cDriveLetterToCheck') # 'C' OR ; LEN(cDriveLetterToCheck) < 2 OR ; SUBSTR(cDriveLetterToCheck,2,1) # ':' OR ; ! BETWEEN(UPPER(LEFT(cDriveLetterToCheck,1)),'A','Z') RETURN '' ENDIF DECLARE INTEGER WNetGetConnection IN Win32API ; STRING @cLocalDrive, ; STRING @cRemoteUNCBuffer, ; INTEGER @nSizeOfBuffer cBuffer = SPACE(511) nResult = WNetGetConnection(LEFT(cDriveLetterToCheck,2), ; @cBuffer, ; 511) IF nResult # 0 * Failed - it's probably not a mapped drive, * or nothing is mapped to it RETURN '' ELSE lcUnc=LEFT(cBuffer,AT(CHR(0),cBuffer)-1) RETURN lcUnc *RETURN LEFT(cBuffer,AT(CHR(0),cBuffer)-1) ENDIF>I have a need to identify the server name that an executable is running from. I know I can get the path of the executable, but that contains the logical drive letter, not the name of the server. Is there a Windows API call or VFP SYS() function for this.