Hi.I jus wanted to know how i can make a program that copies files from one location to another without deleting the original file.
How To Copy Files
Collapse
X
-
Hi
In order to do this yo need to design a form using DirList box and DriveListBox to select source and destination store source and destination address in two textboxes call text1 and text2. Another label can be used to tell user about successful completetion of the process.
then use follwoing code
Dim fso As New Scripting.FileS ystemObject
fso.CopyFolder Text1.Text, Text2.Text, True
Label1.Caption = "backup created successfully at " + Text2.Text -
-
this works so play around with it:
[code=vbnet]
Private Sub Copy()
'access denied to startup path
Dim dest1 As String = "C:\a\a\text.tx t"
If System.IO.File. Exists(dest1) = False Then
Dim origional As String = "C:\a"
System.IO.File. Copy(origional & "\text.txt" , dest1)
End If
End Sub
[/code]
Thanks JamesComment
Comment