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.
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" ) )
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.
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.
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.