About   -   Contact   -   Purchase   -   Search   -   What's New

Convert Long Filenames to Short Filenames
The following API call can be used to convert long filenames into short files names. The API Call is defined as:
function long GetShortPathNameA( string lpLong, 
ref string lpShort, long lBuff ) library 'kernel32'

Then in your Powerscript call the function, note you have to pre-allocate the receiving buffer, this is a standard windows practice. If you forget to allocate the buffer your application will GPF when it exits. ll_RC contains the length of the new short path name.

String ls_Buffer
Long ll_RC

ls_Buffer = Space( 255 )
ll_RC = GetShortPathNameA( as_Long, ls_Buffer, 255 )
RETURN ls_Buffer


Top of Page

Legal Notice

Ken Howe 2011