Results 1 to 2 of 2
  1. #1
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862

    Move or Copy entire directory without looping through files

    Is there a way to use MoveDirectory or CopyDirectory or CopyFolder in Access?

    I want to copy a collection of files and folders without looping through them. I also want to move or rename a directory.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I was able to get this to work

    Code:
    Dim sourceFile As String, destinationFile As String
    Dim aFSO As Object
    sourceFile = "C:\Test\Sub1"
    destinationFile = "C:\Test\NewFolder"
    Set aFSO = CreateObject("Scripting.FileSystemObject")
    aFSO.CopyFolder sourceFile, destinationFile
    Also, I was able to move a directory using the following. Just does not work if the destination folder already exists.

    Code:
    Dim sourceFile As String, destinationFile As String
    Dim aFSO As Object
    sourceFile = "C:\Test\Sub1"
    destinationFile = "C:\Test\NewFolder"
    Set aFSO = CreateObject("Scripting.FileSystemObject")
    aFSO.MoveFolder sourceFile, destinationFile

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Copy Paste the entire MS Access Database
    By mkc80 in forum Access
    Replies: 6
    Last Post: 08-24-2012, 01:07 PM
  2. Copy Entire Record
    By pcli in forum SharePoint
    Replies: 8
    Last Post: 04-23-2012, 03:48 PM
  3. Replies: 6
    Last Post: 06-15-2011, 04:38 PM
  4. Move or Copy a table to another database
    By Harley Guy in forum Access
    Replies: 7
    Last Post: 11-08-2010, 11:49 PM
  5. How to move copy queries and reports.
    By Fred C in forum Access
    Replies: 1
    Last Post: 11-08-2008, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums