Copy Only New or Modified Files

January 24, 2011 at 10:51:00
Specs: Windows XP
I am copying a directory to a storage location and only want to copy new or modified files. Can this be done? Here is the code I am using in Visual Basic 2008 Express.

[Imports System.IO
Public Class Form1

Private Sub CopyButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CopyButton.Click

My.Computer.FileSystem.CopyDirectory("C:\Users\test\", "Z:\Test", FileIO.UIOption.AllDialogs, FileIO.UICancelOption.DoNothing)

End Sub
End Class]

Thanks in Advance

See More: Copy Only New or Modified Files

Report •

January 24, 2011 at 11:35:10

Report •

January 24, 2011 at 14:13:21
I can use xcopy in batch if I wanted to. This concerns Visual Basic.

Report •

January 24, 2011 at 16:22:55
I can use xcopy
In that case . . .

The non-joke answer is to enumerate the files for what you want, and copy those files, creating the destination folder structure as needed. LINQ is awesome for this.

How To Ask Questions The Smart Way

Report •

Related Solutions

Ask Question