DECLARE FUNCTION GetShortPathName LIB "kernel32" _
ALIAS "GetShortPathNameA"(BYVAL lpszLongPath AS STRING, _
BYVAL lpszShortPath AS LONG, BYVAL lBuffer AS LONG) AS LONG
filePath$ = STRING$(100,0)
INPUT "Long filename: ", longFileName$
FilenameLength = GetShortPathName(longFileName$,VARPTR(filepath$),99)
shortFileName$ = LEFT$(filepath$,FilenameLength)
PRINT shortFileName$
INPUT A
|