Private Declare Function GetShortPathName Lib "kernel32" Alias"GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath AsString, ByVal cchBuffer As Long) As LongPrivate Declare Function GetFullPathName Lib "kernel32" _ Alias "GetFullPathNameA" (ByVal lpFileName As String, _ ByVal nBufferLength As Long, ByVal lpBuffer As String, _ lpFilePart As Byte) As LongPrivate Sub Command1_Click()Dim aa As Long, pbase As LongDim FullPath As String, ShortPath As StringDim SouStr As StringDim len5 As LongDim fname() As ByteDim gg As StringSouStr = "C:vb5.exe"ShortPath = String(255, 0)aa = GetShortPathName(SouStr, ShortPath, 256)SouStr = Left(ShortPath, InStr(1, ShortPath, Chr(0)) - 1)Debug.Print SouStrEnd Sub(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)