-
Realise I have had a question today already, this one is to do with copying files from 1 location on a hard drive to another. & I am slightly :confused:
I can use the fso.copyfile property to foce or leave overwriting files. That bit's fine. BUT....
I have been asked for a third option of overwriting only files which are newer. Now I would class myself as an intermediate VB'er, but am stumped with this.
I think I need to use the getfileinfo API call, but anyideas how to loop for each file in a directory, check it's version / modified object (not even sure which method to look at) & either overwrite or leave it ????
PLEASE HELP ANYONE!!! Any small pointers of what I could look at / read into would help, thank you everyone!
Alex Read :confused:
-
If you are already using the FSO, then you can use the following properties of the File object.
DateCreated
DateLastModified
-
use a file box with the local files in it
for a = 0 to file1.listcount-1
if dir(remotepath+file1.list(a))<> "" then
if filedatetime(remotepath+file1.list(a))<> filedatetime(localpath+file1.list(a)) then
kill remotefile
copythefile
end if
else
copythefile
next a
-
response
Thank you, both replies have helped!