* Win32API.PRG PROCEDURE myGetShortPathName LPARAMETERS tcLongPathName * Accepts a path as a parameter. * If the path is invalid or missing then GetFile gets one LOCAL lcLongFile, lcBuffer, lnBufferSize, lnShortPathLen, lcShortPath * Validate parameter IF EMPTY(tcLongPathName) OR ; VARTYPE(tcLongPathName) <> 'C' OR ; !FILE(tcLongPathName) lcLongFile = GETFILE() IF !FILE(lcLongFile) * user cancelled or again entered invalid stuff RETURN ENDIF ELSE * the path is valid lcLongFile = tcLongPathName ENDIF DECLARE INTEGER GetShortPathName IN Win32API ; STRING @cLongPath, ; STRING @cShortPathBuff, ; INTEGER nBuffSize * Example in Visual FoxPro * lcLongFile = "c:\program files\somefolder\my file name.doc" * lcBuffer = SPACE(511) * lnBufferSize = 511 * lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, @lnBufferSize) * lcShortPath = LEFT(lcBuffer, lnBufferSize) * Above should be LEFT(lcBuffer, lnShortPathLen) lcBuffer = SPACE(511) * should this be set to the maximum length allowed for a long path name? lnBufferSize = 511 lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, @lnBufferSize) lcShortPath = LEFT(lcBuffer, lnShortPathLen) RETURN lcShortPathAm I on the right track? Thanks to Erik Moore for the code in the API section and Mike Helland for the cool mhHTML. Congrats too Mike and any other new MVP!