PBDR.COM

About   -   Contact   -   Purchase   -   Search   -   What's New

 

Last Updated 09 June, 2007

Get System Directory
This function returns the system directory path. The function makes use of the GetSystemDirectory API function to return to required path. Add the following code to a FileHandling.bas standard module to compile a File Utility function set:
Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
  "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize _
  As Long) As Long

Function GetSysDir() As String
'*******************************************************
'<DESC>		Retrieves System Dir Path</DESC>
'<RETURN>	System Directory Path</RETURN>
'<ACCESS>	Public
'<USAGE>	strSysPath = GetSysDir()</USAGE>
'*******************************************************
    
    Dim strBuf As String * 256
    Dim lngReturn_len As Long
    
    lngReturn_len = GetSystemDirectory(strBuf, Len(strBuf))
    GetSysDir = Trim$(Left$(strBuf, lngReturn_len))
    
End Function
    
 

Top of Page

Legal Notice

© Ken Howe 2006