Nothing more than converting a long filename to a short 8.3 style filename.
Module
Private Declare Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameA" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long_
) As Long
Public Function ShortName(LongPath As String) As String
'***************************************************************************
' Converts Long FileName to Short FileName
'***************************************************************************
Dim ShortPath As String
Dim Ret As Long
Const MAX_PATH = 260
If LongPath = "" Then
Exit Function
End If
ShortPath = Space$(MAX_PATH)
Ret = GetShortPathName(LongPath, ShortPath, MAX_PATH)
If Ret Then
ShortName = Left$(ShortPath, Ret)
End If
End Function
Usage
Private Sub Command1_Click()
MsgBox ShortName("C:\Program Files\Microsoft Visual Studio\Longexecutable.EXE")
' Good for Shell uses or Name etc
End Sub