Private Declare Function GetSystemDirectory Lib "kernel32" Alias _ "GetSystemDirectoryA" (ByVal lpBuffer As String, _ ByVal nSize As Long) As Long ' The path of the System directoryFunction SystemDirectory() As String Dim buffer As String * 512, length As Integer length = GetSystemDirectory(buffer, Len(buffer)) SystemDirectory = Left$(buffer, length)End Function