Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
        "GetSystemDirectoryA" (ByVal lpBuffer As String, _
        ByVal nSize As Long) As LongPrivate Sub Command1_Click()
  Dim i As Long
  Dim strPath As String  strPath = String(255, 0)
  i = GetSystemDirectory(strPath, 256)
  strPath = Left(strPath, i)
  Debug.Print strPath
End Sub