Option Explicit
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
Dim S As String
S = String(255, " ")
GetSystemDirectory S, 255
S = Left$(S, InStr(S, Chr(0)) - 1)
MsgBox S
End Sub
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
Dim S As String
S = String(255, " ")
GetSystemDirectory S, 255
S = Left$(S, InStr(S, Chr(0)) - 1)
MsgBox S
End Sub