Thread: Back Up
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jeff Standen Jeff Standen is offline
external usenet poster
 
Posts: 49
Default Back Up

Yup - the FileSystemObject. Check out the Excel help for it. You can go
through each file in your drive/folder recursively and check the modified
date, copying it to the new location if it fits your criteria - that'll sort
option 1. You can also check to see if each file exists by looking for the
equivalent file on the target directory and copying the file if you get an
error message (ie the file doesn't exist). Add a reference to Microsoft
Scripting Runtime and declare a new FileSystemObject; that way you can see
all the properties and methods it supports - it's very versatile.

Jeff

"Robin Clay" wrote in message
...
Greetings !

If, while using Windows Explorer,
I drag a folder from one disk to another,
the files in the dragged folder
and its sub-folders are written
to the target disk - regardless.

This means that
(a) newer files may be over-written by older files, and
(b) EVERY file is copied - which can take HOURS.


Challenge 1
I want to do selective backups,
copying from the "main" disk to
a backup disk ONLY those files
more recent than a defined date
(that of the last backup).

Challenge 2
I want to do a different form of
selective backup, copying from
the "main" disk to a backup disk
ONLY those files that either do
not exist on the backup disk,
or are more recent than the version
stored on the backup disk.


My current attempts are based
upon shelling out to DOS to run

dir /s Source.lst
dir /s Target.lst

to generate text files for the two disks.

The Target list is then read in
line-by-line and stored in a worksheet
with one file record on each line,
bearing in adjacent columns
the Drive letter, the path, the filename,
the date and the size.

I then read in the other file line-by-line
and compare this entry with the
tabulated entries. When a match is found,
action is directed into a batch file
that is run upon completion.

"There must be a better way" !

Any ideas would be most welcome !


RClay AT haswell DOT com