Visual Studio-- Copying Files

k3y3n1n

Distinguished
May 20, 2010
7
0
18,510
0
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
 

k3y3n1n

Distinguished
May 20, 2010
7
0
18,510
0
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
 
Thread starter Similar threads Forum Replies Date
A Apps General Discussion 5
2 Apps General Discussion 1
A Apps General Discussion 1
T Apps General Discussion 1
J Apps General Discussion 4
D Apps General Discussion 2
arpitsri Apps General Discussion 3
A Apps General Discussion 10
A Apps General Discussion 5
M Apps General Discussion 4
R Apps General Discussion 4
F Apps General Discussion 1
Rainfire Apps General Discussion 3
W Apps General Discussion 4
M Apps General Discussion 4
M Apps General Discussion 2
S Apps General Discussion 4
Jaakey Apps General Discussion 2
R Apps General Discussion 3
P Apps General Discussion 2

ASK THE COMMUNITY