dos_copy question

Discussion in 'AutoCAD' started by The Real JD, Sep 10, 2004.

  1. The Real JD

    The Real JD Guest

    I'm trying to make Doslib's dos_copy copy a bunch of directories from one
    place to another. I tried just using the * wildcard, but it doesn't copy
    folders. is there another way?

    TIA
     
    The Real JD, Sep 10, 2004
    #1
  2. The Real JD

    Juerg Menzi Guest

    Hi The Read JD

    Try this function:
    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
     
    Juerg Menzi, Sep 12, 2004
    #2
  3. The Real JD

    Juerg Menzi Guest

    Oops...
    Target directory requires a backslash at the end:
    Code:
    ;   Tar = Target directory "C:\\Scrap\\" [STR]
    Cheers
     
    Juerg Menzi, Sep 12, 2004
    #3
  4. The Real JD

    The Real JD Guest

    Thanks! :)
     
    The Real JD, Sep 14, 2004
    #4
  5. The Real JD

    Jürg Menzi Guest

    Welcome...¦-)

    Cheers
     
    Jürg Menzi, Sep 14, 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.