|
|
|
Click here to copy the following block |
Sub SynchronizeDirectoryTrees(ByVal sourceDir As String, _ ByVal destDir As String, Optional ByVal TwoWaySync As Boolean) Dim fso As New Scripting.FileSystemObject Dim sourceFld As Scripting.Folder Dim destFld As Scripting.Folder Dim fld As Scripting.Folder Dim col As New Collection On Error Resume Next Set sourceFld = fso.GetFolder(sourceDir) Set destFld = fso.GetFolder(destDir)
If Err Then fso.CopyFolder sourceDir, destDir Exit Sub End If SynchronizeDirectories sourceDir, destDir, TwoWaySync If Right$(sourceDir, 1) <> "\" Then sourceDir = sourceDir & "\" If Right$(destDir, 1) <> "\" Then destDir = destDir & "\" For Each fld In sourceFld.SubFolders col.Add fld.Name, fld.Name SynchronizeDirectoryTrees fld.Path, destDir & fld.Name, TwoWaySync Next If TwoWaySync Then For Each fld In destFld.SubFolders If col(fld.Name) = "" Then fso.CopyFolder fld.Path, sourceDir & fld.Name End If Next End If
End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|