here's an api function that gives you a short path from a file path:
vb Code:
Public Class Form1 Declare Function GetShortPathName Lib "kernel32" _ Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, ByVal cchBuffer As Integer) As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim shortPath As New String(" "c, 256) GetShortPathName("long path here", shortPath, 256) MsgBox(shortPath.Trim) End Sub End Class




Reply With Quote