Results 1 to 2 of 2

Thread: how can I conver a short dos path to windows path?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Question how can I conver a short dos path to windows path?

    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)

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    VB Code:
    1. Public Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long
    2.  
    3.  
    4. Public Function GetLongFilename(ByVal sShortFilename As String) As String
    5.     Dim lRet As Long
    6.     Dim sLongFilename As String
    7.     sLongFilename = String$(1024, " ")
    8.     lRet = GetLongPathName(sShortFilename, sLongFilename, Len(sLongFilename))
    9.    
    10.     If lRet > Len(sLongFilename) Then
    11.         sLongFilename = String$(lRet + 1, " ")
    12.         lRet = GetLongPathName(sShortFilename, sLongFilename, Len(sLongFilename))
    13.     End If
    14.    
    15.     If lRet > 0 Then
    16.         GetLongFilename = Left$(sLongFilename, lRet)
    17.     End If
    18.    
    19. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width