7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" _
(ByVal lpszShortPath As String, ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long
Private Sub Form_Load()
Dim a As String, b As String, c As Long
a = Environ("Temp")
b = Dir(a & "\*.*")
b = a & "\" & b
Dim L As String * 1000
c = GetLongPathName(b, L, 999&)
Debug.Print L
End Sub
Private Sub Command1_Click()
Set fso = CreateObject("Scripting.FileSystemObject")
Set sh = CreateObject("Shell.Application")
MsgBox sh.NameSpace(fso.GetSpecialFolder(2).Path).Self.Path
End Sub