Applecore Pages on Microsoft Access

How to create all folders in a path

If you are installing software, and you wish to install the software to "C:\Folder1\Folder2\Folder3" then you will either need to recursively use Dir to check for the existence of each folder, and then use MkDir to create it, or else you can use an API call to do this:

Private Declare Function apiMakeSureDirectoryPathExists Lib "Imagehlp.dll" Alias "MakeSureDirectoryPathExists" _
    (ByVal DirPath As String) As Long
 
Function fCreateFullDir(strFullPath As String) As Boolean
'   Function to create if ncessary all folders in a path
'   Accepts
'       A string that is the full name of the path - this must be terminated with a "\"
'   Returns
'       True if all of the folders were created (or already existed)
'       False if one or more of the folders could not be created

    fCreateFullDir = apiMakeSureDirectoryPathExists(strFullPath)
End Function

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 14:53:13