Private Declare Function GetShortPathName Lib "kernel32" Alias _ "GetShortPathNameA" (ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Function GetDosPath(ByVal vStrPath As String) As String Dim lngRetVal As Long Dim lngBuffer As Long Dim strShortPath As String ' Pad the destination buffer with zeros, to the length of the input path. strShortPath = String$(Len(vStrPath), 0) ' Set the size of the buffer pointed to by strShortPath. lngBuffer = Len(strShortPath) lngRetVal = GetShortPathName(vStrPath, strShortPath, lngBuffer) ' Strip the trailing null terminator. GetDosPath = Left$(strShortPath, lngRetVal) End Function