Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Const FOLDER_FROM As String = "C:\Testcopy1" ' Folder to copy from Const FOLDER_TO As String = "C:\Mappestruktur" 'Folder to create above folder in Dim newDir As DirectoryInfo = Directory.CreateDirectory(FOLDER_TO & "\" & New DirectoryInfo(FOLDER_FROM).Name) CopyFiles(New DirectoryInfo(FOLDER_FROM), newDir) End Sub Private Sub CopyFiles(ByVal FolderFrom As DirectoryInfo, ByVal FolderTo As DirectoryInfo) Dim Files() As String = Directory.GetFiles(FolderFrom.FullName) Dim SF() As String = Directory.GetDirectories(FolderFrom.FullName) Dim Var As Integer For Var = Files.GetLowerBound(0) To Files.GetUpperBound(0) File.Copy(Files(Var), FolderTo.FullName & "\" & New FileInfo(Files(Var)).Name) Next For Var = SF.GetLowerBound(0) To SF.GetUpperBound(0) Dim dName As String = New DirectoryInfo(SF(Var)).Name Dim newD As New DirectoryInfo(FolderTo.FullName & "\" & dName) newD.Create() CopyFiles(New DirectoryInfo(FolderFrom.FullName & "\" & dName), newD) Next End Sub
System.IO.Directory.Move
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)