How to return the path to the windows directory.
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 | 'System & API - How to return the path to the windows directory. Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _ (ByVal lpBuffer As String, ByVal nSize As Long) As Long Public Function WindowsDir() As String Dim Gwdvar As String, Gwdvar_Length As Integer Gwdvar = Space(255) Gwdvar_Length = GetWindowsDirectory(Gwdvar, 255) WindowsDir = Left(Gwdvar, Gwdvar_Length) End Function 'How can I call this function: 'Debug.Print WindowsDir |