' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.IO

Module Main
    Sub Copy(fnm1 As String, fnm2 As String)
        Console.WriteLine(fnm1 & " -> " & fnm2)
    End Sub
    Sub CopyDir(dir1 As String, dir2 As String)
        Dim files As String() = Directory.GetFiles(dir1)
        For Each f As String In files
            Copy(f, dir2 & f.Substring(dir1.Length))
        Next
        Dim dirs As String() = Directory.GetDirectories(dir1)
        For Each d As String In dirs
            CopyDir(d, dir2 & d.Substring(dir1.Length))
        Next
    End Sub
    Sub Main()
        CopyDir("C:\WINNT", "D:\WINNT")
    End Sub
End Module
