Results 1 to 5 of 5

Thread: How to FAST multiple file copy (200+ files)

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    How to FAST multiple file copy (200+ files)

    Esteemed Forum Participants and Lurkers:

    I searched and found a reference to "Multiple File Copy":

    --------------------------------------------------------------------------------
    Originally posted by sameer spitfire
    isn't there any option rather than looping around the files??

    just an alternative
    regards
    --------------------------------------------------------------------------------
    Reply from Pirate:

    And what's wrong with loop structures ? There might be other alternatives but can't think of any now .
    --------------------------------------------------------------------------------

    File-by-file loop to copy is HORRIBLY slow! I have one folder of 166 files to copy. Is there any other FAST way to do it? I even thought about writing a batch file to do a wild card copy, and then calling it from VB.

    Thanks for any comments, suggestions, or assistance.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  2. #2
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618
    I believe the FileSystemObject(FSO) has a Copy folder function that might be useful to you.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  3. #3
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    Best I can Think of this

    VB Code:
    1. Dim di as New DirectoryInfo("dir")
    2. Dim fi() as FileInfo = di.GetFiles("Pattern")
    3.  
    4. For Each f as FileInfo in fi
    5.  
    6.     'Copy the file ;)
    7.  
    8. Next

    If the user is using a slow computer it will be slow....
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Webtest
    Esteemed Forum Participants and Lurkers:

    I searched and found a reference to "Multiple File Copy":

    --------------------------------------------------------------------------------
    Originally posted by sameer spitfire
    isn't there any option rather than looping around the files??

    just an alternative
    regards
    --------------------------------------------------------------------------------
    Reply from Pirate:

    And what's wrong with loop structures ? There might be other alternatives but can't think of any now .
    --------------------------------------------------------------------------------

    File-by-file loop to copy is HORRIBLY slow! I have one folder of 166 files to copy. Is there any other FAST way to do it? I even thought about writing a batch file to do a wild card copy, and then calling it from VB.

    Thanks for any comments, suggestions, or assistance.
    Foreach loop is faster than any other loop , as MS says . How can you do it without use any kind of loop ??????

    API copy methods could be a little faster than the managed code ,I imagine .

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    But you want to copy files or to move them? Copying files depends on your system - not in .net speed.
    Moving takes only like 1 sec for all files.
    \m/\m/

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