
Getting a File's Dos Name and Path
Hi!
Use this:
Option Explicit
Declare Function GetShortPathName& Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long)
Function GiveShortPathName(ByVal lpszLongPath As String) As String
Dim lpszShortPath As String
Dim cchBuffer As Long
Dim result As Long
lpszShortPath = String(256, " ")
result = GetShortPathName(lpszLongPath, lpszShortPath, 256)
GiveShortPathName = Mid(lpszShortPath, 1, result)
End Function
Enjoy!
De E-Woud
Tip of the day: DON'T GET DESTROYED.
Hi,
How do you get a File's Dos(8.3) name and path?
Thanks,
Chanan