Recursive File Count Function
Dim fileCount As Integer = 0
Dim Dir As New System.IO.DirectoryInfo("c:\")
RecursiveCount(Dir, fileCount)
End Sub Private Sub RecursiveCount(ByVal theDir As DirectoryInfo, ByRef Count As Integer)
Dim subDirectories() As DirectoryInfo = theDir.GetDirectories
For i As Integer = 0 To subDirectories.Length - 1
Dim subFiles() As FileInfo = subDirectories(i).GetFiles
Count += subFiles.Length
Debug.Write(subDirectories(i).FullName & Chr(13))
RecursiveCount(subDirectories(i), Count)
Next
End SubAnother hour and I'll be finished with the function to recreate the new linked directories for CarbonCopy.NET. It's kind of complicated, because you have to recreate a new directory structure from a different root. I think I have it about down though. We'll see in about an hour.