Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
'作者:蔡渭铭
'E-Mail: daniel_0571@263.net
Dim sSave As String, Ret As Long
'Create a buffer
sSave = Space(255)
'获得系统路径
Ret = GetSystemDirectory(sSave, 255)
'以去掉没用的空串(chr(0))
sSave = Left$(sSave, Ret)
'显示路径
MsgBox "Windows System directory: " + sSave
End Sub