Does anyone know how to copy subfolders from one place to another in VB?. I have a Template folder on a network share I want to use to set up the base folder structure on newly created job folders, however, I can't seem to get any copy methods to take just the subfolders and not the parent.
The base (from) template folder is structrued as;
\\server\
..\_templates\
....\input\
......\communications\
......\data\
.....\output\
......\communications\
......\data\
and so on..
I have:
Public Sub CopyFilesFolder2Folder(Foldername As String)
Dim fso
sfol = "\\server\main_jobs\_Templates\" ' source folder path
dfol = Foldername ' destination folder path
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.GetFolder(sfol)
fso.GetFolder(Folder).Copy dfol
Set fso = Nothing
This copy's the folder just fine, but, carrys the parent (_Templates) too, so the resulting desitnation is \\newserver\newjob\_Templates\folder1, 2, 3, ect. wher I want it to be \\newserver\newjob\folder1, 2, 3, ect.
Any ideas?, I'm stumped on this.