Results 1 to 5 of 5

Thread: Copying all files and subdirectories in a directory

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Smile Copying all files and subdirectories in a directory

    Hi guys.

    I'm writing a program for my work that is supposed to copy a directory from any location (Including our server machine) to another directory specified elsewhere.

    I can get it to work with small directories using My.Computer.FileSystem.CopyDirectory(), but this seems to time out and cause some COM threading error in VB that talks about how long operations can time out or something when I am debugging it on our 2GB directories.

    I'm actually kinda new to VB, so I was wondering if anyone has any code snippets or ideas on how to speed up and stabilize the process of copying all the files and subdirectories of a directory into another directory. The goal is to copy large directories of files and subdirectories efficiently and as stable and quick as possible. I am using Visual Basic 2005.
    My code is as follows, again, very simple, and not very stable with large directories.

    Try
    My.Computer.FileSystem.CopyDirectory(QASharePath, StableSharePath, True)
    Catch ex As Exception
    MsgBox("QA To Stable: Unable to complete the operation. Please check the paths and try again.")
    End Try

    Thank you for any suggestions or help you can give me. Happy Coding!
    Last edited by gholin; Mar 20th, 2007 at 08:35 PM.

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