Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private sRet As String
Private lRet As Long
Public Sub GetSysFolders(WinSysPath As String, WinPath As String)
sRet = Space(260)
lRet = GetSystemDirectory(sRet, Len(sRet)) 'get the path
WinSysPath = Left(sRet, lRet) 'parse the path into the global string
lRet = GetWindowsDirectory(sRet, Len(sRet)) 'get the path
WinPath = Left(sRet, lRet) 'parse the path to the global string