devxlogo

LongPathName – Convert a 8.3 file name to long format

LongPathName – Convert a 8.3 file name to long format

Private Declare Function GetLongPathName Lib "kernel32" Alias _    "GetLongPathNameA" (ByVal lpszShortPath As String, _    ByVal lpszLongPath As String, ByVal cchBuffer As Long) As LongConst MAX_PATH = 260' Convert a short file/path name to a long name' the file or path must exist' returns a null string in case of error'' IMPORTANT: this function is only available under'            Windows 98 and Windows 2000Public Function LongPathName(ByVal FileName As String) As String    Dim length As Long, res As String    On Error Resume Next        res = String$(MAX_PATH, 0)    length = GetLongPathName(FileName, res, Len(res))    If length And Err = 0 Then        LongPathName = Left$(res, length)    End IfEnd Function

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist