Sign-in / Sign-up
Your question

Visual Studio-- Copying Files

Tags:
  • Programming
  • Filesystem
  • Visual Studio
  • Computers
  • Apps
Last response: in Apps General Discussion
June 25, 2010 4:03:44 PM

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, _
FileIO.UICancelOption.DoNothing)


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


Also how put the date stamp on directory

More about : visual studio copying files

June 25, 2010 4:57:45 PM

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
Else
fs.createfolder folderpath & "\Log\" & Replace(Format(Now(), "dd/MM/yyyy"), "/", "_")
End If

Else
'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
m
0
l
June 28, 2010 2:26:32 PM

ANYONE?
m
0
l