How can I convert long filename to DOS filename in Delphi

To convert a long filename to a DOS filename (also known as an 8.3 filename) in Delphi, you can use the GetShortPathName function from the Windows API. This function takes a long filename as input and returns the corresponding short (8.3) filename.

Here is an example of how to use the GetShortPathName function to convert a long filename to a short filename in Delphi:

This function takes a long filename as input and returns the corresponding short filename. If the conversion fails, it returns the original long filename.

To use this function, you can simply pass in the long filename as a string and assign the returned value to a string variable. Here is an example of how to use the LongToShortFilename function:

 


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *