Results 1 to 6 of 6

Thread: filecopy function???????????????

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    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.

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    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??

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Add a reference to Microsoft Scripting Runtime

    sound familiar?

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    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.

  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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




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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width