Hi, I am writting an application which is seppose to backup couple of folders. But when I use the file copy to copy a folder I get an error message. Is it possible to use the filecopy to copy folders????? I really appreciate if someone help me.
Printable View
Hi, I am writting an application which is seppose to backup couple of folders. But when I use the file copy to copy a folder I get an error message. Is it possible to use the filecopy to copy folders????? I really appreciate if someone help me.
Add a reference to Microsoft Scripting Runtime
Code:Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
fso.CopyFolder "C:\Test1", "C:\Test2", True
Set fso = Nothing
To Clunietp
Thanks for your response.
I tried the code by putting it into the form_load procedure but I get an error message for the first line which was:
Dim fso As scripting.filesystemobject
CODE
===========================================
Private Sub Form_Load()
Dim fso As scripting.filesystemobject
Set fso = New scripting.filesystemobject
fso.copyfolder "c:\my download files, "c:\windows\desktop\downloads", True
Set fso = Nothing
End Sub
===========================================
End Code
I don't know what is the problem can you help me out again please??
Add a reference to Microsoft Scripting Runtime
sound familiar? :)
TO Clunietp
I am sorry but I have never done that and I tried what you told me and it did not work. Do you have any sample application or anything I can see the codes and how it works.
Thanks alot again.
Select References from the Project menu. From the selection in the listbox, select Microsoft Scripting Runtime (make sure the checkbox is checked). Then use the code Tom provided.
------------------
Serge
Software Developer
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 01-24-2000).]