Griffinator
Programmer
Hi,
I am having trouble creating multiple subfolders at one time using the File System Object.
Example:
Using the CreateFolder() method of the FileSystemObject, I am having no trouble creating the folder "Backup" in say the root of the drive (ie: "C:\Backup"
. This holds true for any path that exists up to "\Backup"
However, if I try to create the path "C:\Backup\Data" when neither the Backup folder nor the Data folder currently exist, I get a "Path not found" error. I understand that this is happening because the Data folder cannot be created in a folder that doesn't currently exist, but I am unable to figure out a way to first create the Backup folder then the Data folder so that this error doesn't occur.
The reason I am doing this is because the path is user defined, so I will never be sure how many folders and subfolders the user will want to create.
Thanks in advance for any and all suggestions.
I am having trouble creating multiple subfolders at one time using the File System Object.
Example:
Using the CreateFolder() method of the FileSystemObject, I am having no trouble creating the folder "Backup" in say the root of the drive (ie: "C:\Backup"
However, if I try to create the path "C:\Backup\Data" when neither the Backup folder nor the Data folder currently exist, I get a "Path not found" error. I understand that this is happening because the Data folder cannot be created in a folder that doesn't currently exist, but I am unable to figure out a way to first create the Backup folder then the Data folder so that this error doesn't occur.
The reason I am doing this is because the path is user defined, so I will never be sure how many folders and subfolders the user will want to create.
Thanks in advance for any and all suggestions.