PDA

Click to See Complete Forum and Search --> : filecopy function???????????????


MMSS
Jan 23rd, 2000, 02:48 AM
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.

Clunietp
Jan 23rd, 2000, 03:34 AM
Add a reference to Microsoft Scripting Runtime


Dim fso As Scripting.FileSystemObject

Set fso = New Scripting.FileSystemObject

fso.CopyFolder "C:\Test1", "C:\Test2", True

Set fso = Nothing

MMSS
Jan 23rd, 2000, 11:41 AM
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??

Clunietp
Jan 23rd, 2000, 12:15 PM
Add a reference to Microsoft Scripting Runtime

sound familiar? :)

MMSS
Jan 23rd, 2000, 01:30 PM
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.

Serge
Jan 23rd, 2000, 09:18 PM
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
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)




[This message has been edited by Serge (edited 01-24-2000).]