Results 1 to 2 of 2

Thread: how to find the MS-Dos name

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49
    Is there a good API function that can give you a folder 's name in ms-dos
    EXAMPLE: the folder Program files is named PROGRAM~1 in dos.

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
    Private Const MAX_PATH = 260


    function shortname(strLongPath as string) as string

    Dim strPath As String, intPathLen As Integer
    strPath = Space$(MAX_PATH)
    intPathLen = GetShortPathName(strLongPath, strPath, MAX_PATH)
    shortname = Left(strPath, intPathLen)

    end function

    You will have to provide the eror checking, but here is a basis to start from.

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