Visual Studio-- Copying Files

I am using Visual Studio 2010 what i want to do is copy all the files in one directory >> Then create a new directory with the current date and place those copied files into that new directory.

I was using this

My.Computer.FileSystem.CopyFile( _
"C:\UserFiles\TestFiles\testFile.txt", _
"C:\UserFiles\TestFiles2\testFile.txt", _
FileIO.UIOption.AllDialogs, _

but do i really have to list every file or can i jut do *.txt

Also how put the date stamp on directory
2 answers Last reply
More about visual studio copying files
  1. this what i got for the date stamp on folder

    Public Sub fnCreateLogFolder()
    Dim fs
    Dim folderpath

    'create reference for file system object
    Set fs = CreateObject("Scripting.FileSystemObject")

    'set basic folder path to D: we avoid c: because it may be contain system files
    folderpath = "D:\"

    'Check folder name "log" in folderpath
    If fs.FolderExists(folderpath & "\Log") = True Then

    If fs.FolderExists(folderpath & "\Log\" & Replace(Format(Now(), "dd/MM/yyyy"), "/", "_")) = True Then
    Exit Sub
    fs.createfolder folderpath & "\Log\" & Replace(Format(Now(), "dd/MM/yyyy"), "/", "_")
    End If

    'if log folder missing then create it
    fs.createfolder folderpath & "\Log"
    fs.createfolder folderpath & "\Log\" & Replace(Format(Now(), "dd/MM/yyyy"), "/", "_")
    End If

    End Sub

    need help on copying files
  2. ANYONE?
Ask a new question

Read More

Programming Filesystem Visual Studio Computers Apps