DOS Question

Discussion in 'AutoCAD' started by Tom Smith, Sep 10, 2004.

  1. Tom Smith

    Tom Smith Guest

    Does anyone know a way to generate a list of all files in a folder and its
    subfolders, sorted by date? I've tried a batch file of the form:

    dir "<customfolder>\*.*" /b /s /o:-d /T:w /A:-d > dir.txt

    This will give me names of all the filenames (but not folder names) under
    <customfolder> and direct the output to a text file. However, the files are
    sorted by date only within their folders. For instance, all the files in
    Folder0 are given in descending order, then all the files in Folder1 in
    descending order, and so forth. I'd like to have the whole listing sorted by
    date.
     
    Tom Smith, Sep 10, 2004
    #1
  2. Tom Smith

    The Real JD Guest

    at the cmd prompt:

    tree /f /a >>list.txt
     
    The Real JD, Sep 10, 2004
    #2
  3. Tom Smith

    The Real JD Guest

    Sorry, i didn't notice the date sorting issue. So i retract the former post.
     
    The Real JD, Sep 10, 2004
    #3
  4. Tom Smith

    Kelie Guest

    I think you can either use doslib functions or the FileSystemObject which can be referenced by
    (setq objFSO (vla-getinterfaceobject
    (vlax-get-acad-object)
    "Scripting.FileSystemObject"
    )
    )
     
    Kelie, Sep 10, 2004
    #4
  5. Tom Smith

    Tom Smith Guest

    Thanks, but I can't puzzle out a way to do this with doslib, and I'm clueless on FileSystemObject.

    What I'm trying to do is synchronize a standalone Acad installation with a master copy of our customizations on a network drive.

    All of our customizations (approx 1200 files) are in a tree of folders, which should be duplicated on the local drive. I want to check whether any files in the network tree are newer than files on the local drive (or not present on the local drive) and if so copy them down.

    I've got a routine based on doslib functions which will do this by comparing dates of the files listed in the dir.txt file generated by my batch file. If these were sorted from newest to oldest, the routine could stop as soon as it found a file that's not newer. But since the entire listing isn't sorted by date, the routine has to compare all 1200 files.

    This is much faster than simply doing a brute-force xcopy, but still slower than I'd like. When the master copy is updated, usually only a couple of dozen files are affected.
     
    Tom Smith, Sep 11, 2004
    #5
  6. Tom Smith

    Doug Broad Guest

    Use Laplink, available for about $70.
    I do it practically every day.
     
    Doug Broad, Sep 11, 2004
    #6
  7. Is the stand-alone copy on a laptop? If so, look into Offline Files in
    Win2k/XP.

    --
    R. Robert Bell


    Thanks, but I can't puzzle out a way to do this with doslib, and I'm
    clueless on FileSystemObject.

    What I'm trying to do is synchronize a standalone Acad installation with a
    master copy of our customizations on a network drive.

    All of our customizations (approx 1200 files) are in a tree of folders,
    which should be duplicated on the local drive. I want to check whether any
    files in the network tree are newer than files on the local drive (or not
    present on the local drive) and if so copy them down.

    I've got a routine based on doslib functions which will do this by comparing
    dates of the files listed in the dir.txt file generated by my batch file.
    If these were sorted from newest to oldest, the routine could stop as soon
    as it found a file that's not newer. But since the entire listing isn't
    sorted by date, the routine has to compare all 1200 files.

    This is much faster than simply doing a brute-force xcopy, but still slower
    than I'd like. When the master copy is updated, usually only a couple of
    dozen files are affected.
     
    R. Robert Bell, Sep 12, 2004
    #7
  8. Tom Smith

    John Uhden Guest

    Just get "Second Copy" http://www.centered.com I think it's still $30.




    master copy of our customizations on a network drive.
    should be duplicated on the local drive. I want to check whether any files in
    the network tree are newer than files on the local drive (or not present on the
    local drive) and if so copy them down.
    dates of the files listed in the dir.txt file generated by my batch file. If
    these were sorted from newest to oldest, the routine could stop as soon as it
    found a file that's not newer. But since the entire listing isn't sorted by
    date, the routine has to compare all 1200 files.
    than I'd like. When the master copy is updated, usually only a couple of dozen
    files are affected.
     
    John Uhden, Sep 12, 2004
    #8
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.