Copy fonction

Discussion in 'AutoCAD' started by Marcel Goulet, Oct 18, 2004.

  1. Hi,

    I need to copy an entire folder containing subfolders and files.

    I tryied using the fonction vl-file-copy and dos_copy, but it doesn't work.

    Thanks
     
    Marcel Goulet, Oct 18, 2004
    #1
  2. Marcel Goulet

    Jürg Menzi Guest

    Hi Marcel

    Try this one:
    Code:
    ;
    ; -- VxCopyFolders
    ; Copies the specified folder(s).
    ; Copyright:
    ;   ©2002 MENZI ENGINEERING GmbH, Switzerland
    ; Arguments [Typ]:
    ;   Src = Source folder(s) to copy "C:\\Temp\\*" [STR]
    ;   Tar = Target directory "C:\\Scrap\\" [STR]
    ; Return [Typ]:
    ;   > T   VxCopyFolders succeed
    ;   > nil Error on copy folder(s)
    ; Notes:
    ;   - Requires ScrRun.dll
    ;   - Target folder must exist
    ;   - Existing folders or files are to be overwritten.
    ;
    (defun VxCopyFolders (Src Tar / ErrObj FilSys RetVal)
    (setq FilSys (vlax-create-object "Scripting.FileSystemObject")
    ErrObj (vl-catch-all-apply
    'vlax-invoke-method
    (list FilSys 'CopyFolder Src Tar :vlax-true)
    )
    RetVal (not (vl-catch-all-error-p ErrObj))
    )
    (vlax-release-object FilSys)
    RetVal
    )
    
    Cheers
     
    Jürg Menzi, Oct 18, 2004
    #2
  3. Marcel Goulet

    Walt Engle Guest

    My question, which is in answer to your post is: why not use Winfile or
    2xExplorer? With either of these, you can copy entire folders and sub-folders
    and in doing it, you have have more than one window to see what you're doing.
     
    Walt Engle, Oct 18, 2004
    #3
  4. Thanks,

    That's exactly what I need.

    Marcel
     
    Marcel Goulet, Oct 19, 2004
    #4
  5. Marcel Goulet

    Jürg Menzi Guest

    Welcome...¦-)

    Cheers
     
    Jürg Menzi, Oct 19, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.