CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Location
    US NJ
    Posts
    113

    Copying Folders from one place to another...

    How can I copy a folder, with everything in it, to other locatrion, using VB code?

    Thanks in advance

    Leo


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Copying Folders from one place to another...

    The simplest method is to set a reference to the Microsoft Scripting Runtime and use the FileSystemObject... ie:


    private Sub Command1_Click()
    Dim fs as FileSystemObject

    set fs = new FileSystemObject
    fs.CopyFolder "c:\myfolder", "c:\newfolder", false

    End Sub




    You could also use the SHFileOperation API call if you want to see the Windows copy animation window.


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

Featured