模块中:
'获得System的路径
Public Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
'Const MAX_PATH = 260
Public Function GetSysDir()
Dim b As String
Dim p As Integer
b = Space(260)
p = GetSystemDirectory(b, Len(b))
GetSysDir = left(b, p)
MsgBox GetSysDir
End Function