bigMre bigMre - 1 year ago 90 Question

Rename Folder with errors

Okay so i find another option, thats simpler. I want to rename the folder at Destination, but it dosnt work.

Dim Log As String = System.IO.Path.Combine(DateTime.Now.ToString("yyyy_MM_dd_HHmmss"))
Process.Start("CMD", "/c robocopy.exe " & Source & " " & Destination & "/z /log:C:\Backup\log_" & Log & ".txt")

Dim Copy2 As String = ("Backup_" & DateTime.Now.ToString("yyyy_MM_dd_HHmmss"))
My.Computer.FileSystem.RenameDirectory(Destination, Copy2)
Process.Start(Copy2) 'öffnet explorer
MsgBox("Backup ist vollendet!")

Answer Source

Is this what you're after:

Dim directory As String = "C:\Backup\Here"

Dim newDirectory As String = directory.Substring(0, directory.LastIndexOf("\"))

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download