How can I conver one of those shortened paths like msdos paths to windows paths (the actual file is not shortened)
(like when you have progra~1 instead of program files)
Printable View
How can I conver one of those shortened paths like msdos paths to windows paths (the actual file is not shortened)
(like when you have progra~1 instead of program files)
VB Code:
Public Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long Public Function GetLongFilename(ByVal sShortFilename As String) As String Dim lRet As Long Dim sLongFilename As String sLongFilename = String$(1024, " ") lRet = GetLongPathName(sShortFilename, sLongFilename, Len(sLongFilename)) If lRet > Len(sLongFilename) Then sLongFilename = String$(lRet + 1, " ") lRet = GetLongPathName(sShortFilename, sLongFilename, Len(sLongFilename)) End If If lRet > 0 Then GetLongFilename = Left$(sLongFilename, lRet) End If End Function