Article ID: 109733
Article Last Modified on 5/6/2003
'**********************************
'Declarations section of the module
'**********************************
Option Compare Database
Option Explicit
Declare Function GetWindowsDirectory% Lib "Kernel" (ByVal lpbuffer _
As String, ByVal nsize As Integer)
Declare Function GetSystemDirectory% Lib "Kernel" (ByVal lpbuffer _
As String, ByVal nsize As Integer)
'Returns the path to the Windows directory as a string.
Function GetWinDir () As String
Dim lpbuffer As String * 144
Dim Length%
Length% = GetWindowsDirectory(lpbuffer, Len(lpbuffer))
GetWinDir = Left(lpbuffer, Length%)
End Function
'Returns the path to the Windows System directory as a string.
Function GetSysDir () As String
Dim lpbuffer As String * 144
Dim Length%
Length% = GetSystemDirectory(lpbuffer, Len(lpbuffer))
GetSysDir = Left(lpbuffer, Length%)
End Function
Additional query words: path system windows api ab
Keywords: kbhowto kbprogramming KB109733