PDA

View Full Version : Copying files



Helplesss
20-04-2005, 02:14 PM
I have a series of zip files created for backups. What I want to do is using copy or xcopy in a batch file, only copy the latest *.zip file to another location. Can it be done? Thanks in Advance, Helplesss

sal
20-04-2005, 02:21 PM
What is the file/directory structure for these files?

Graham L
20-04-2005, 02:24 PM
Do /xcopy /? to see its options . I am assuming that this is to be a frequent task, so it's worth making a batch file. (Sometimes it's quicker to do things manually than to automate them ;)).

xcopy can use the Archive attribute to decide what file(s) to copy, and then reset the bit. So with the appropriate options set it will copy today's file. But tomorrow, it won't copy that file again.

If you've got a number of files already there, you might want to use attrib (or the Windows "Properties" box) to turn off the Archive bit for them.

Helplesss
20-04-2005, 03:43 PM
Thanks Graham L, your suggestion has some promise!