devxlogo

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

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

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.