Hello,
I tried to copy a certain directory using:
FileCopy "C:\bla bla", "A:\"
It returns a message saying:
"Path/File Access Error"
Can anyone help?
Thank you
Printable View
Hello,
I tried to copy a certain directory using:
FileCopy "C:\bla bla", "A:\"
It returns a message saying:
"Path/File Access Error"
Can anyone help?
Thank you
Here's an example. Make a Form with 2 CommandButtons.
Put this code in Command1
Put this code in Command2.Code:Private Sub Command1_CLick()
Open "C:\test.txt" For Output As #1
Print #1, "abcdefghijklmnopqrstuvwxyz"
Close #1
End Sub
Code:Private Sub Command2_Click()
SFile = "C:\ttt.txt"
DFile = "A:\"
FileCopy SFile, DFile
End Sub
You cannot copy a folder automatically. To do it manually
Make the main sub using mkdir
Loop trough all items in you subdir by using dir or fso object and copy the files independently.
Thanks, but how do you make the loop to send the files in the folder to "A:"?
HAven't tested it, i just wrote it down here
Code:Dim a$
A=dir(yourdir)
do while len(a)
filecopy a, "a:\" & a
a=dir
loop