Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Private Sub Command1_Click() Dim sshortname As String * 255 Dim pos As Integer Dim llongname As String llongname = "C:\Documents and Settings" pos = GetShortPathName(llongname, sshortname, Len(sshortname)) Print LCase(Left(sshortname, pos)) End Sub
Private Sub Command1_Click()
Dim sshortname As String * 255
Dim pos As Integer
Dim llongname As String
llongname = "C:\Documents and Settings"
pos = GetShortPathName(llongname, sshortname, Len(sshortname))
Print LCase(Left(sshortname, pos))
End Sub