This function will generate / create a single folder (if the parent path already exist) or a complete path+folder if the absolute path doesn't already exist.
Function GeneratePath(pFolderPath)
GeneratePath = False
If Not objFSO.FolderExists(pFolderPath) Then
If GeneratePath(objFSO.GetParentFolderName(pFolderPath)) Then
GeneratePath = True
Call objFSO.CreateFolder(pFolderPath)
End If
Else
GeneratePath = True
End If
End Function
Example
This example will create a complete path if test1....test8 will not exist....
GeneratePath("C:\test1\test2\test3\test4\test5\test6\test7\test8\test9")
SOURCE | LINK | LANGUAGE | ENGLISH |
GeneratePath (VBScript function to create folders recursively) http://heelpbook.altervista.org/2012/generatepath-vbscript-function-to-create-folders-recursively/ via @HeelpBook