Google Reviews
If you find this content or our services useful, please leave us a review.


The Filesystem Object cannot create a nested folder structure in a single invocation of the CreateFolder method.  For example, if we tried executing the following code it would return a ‘Path Not Found’ error unless c:\alkanesolutions\ already exists:

objFSO.CreateFolder “c:\alkanesolutions\test\”

The function below resolves this limitation.


Technet Forums


Dim FullPath : FullPath = "c:\alkanesolutions\test\folder"
Dim objFSO : Set objFSO = CreateObject("Scripting.FilesystemObject")

BuildFullPath FullPath

Sub BuildFullPath(ByVal FullPath)
  If Not objFSO.FolderExists(FullPath) Then
    BuildFullPath objFSO.GetParentFolderName(FullPath)
    objFSO.CreateFolder FullPath
  End If
End Sub



Create a Nested Folder Structure using VBScript
Comments have now been disabled. If you have a question to ask about this post please ask the community!