Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Using Batch files I'm looking to backup files from certain directories to a backup drive. I'm using XCopy to backup some of the smaller folders. But some directories(music directories & subdirectories) only need to backup files that don't already exist in the destination/backup folder. I have an idea that I can use 'Replace' to backup files but I need to use this to search all sub directories as well.
Stef

XCOPY has many different parameters that you can utilize. You can see a full list here.
You say "some directories(music directories & subdirectories) only need to backup files that don't already exist in the destination". What about files that already exist but which have been updated? Do you want those copied too?
By default XCOPY will not copy files that exist in the destination and have not been modified.
From the link above:
"/d[:mm-dd-yyyy] : Copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed."
So, just add the /d parameter to your XCOPY command.
Michael J

I will use seperate batch files for different backups. They'll be run at different times.
So I'll replace all files in the smaller sized directories, but for music directories(mp3's which won't be changed) I will use XCOPY with the date parameter to eliminate needlessly overwriting existing files in the destination.Well, cheers for that man, I completely overlooked the date parameter. I'm in work now so I'll try that later on.
Stef

![]() |
Make *.ini file
|
Finstr command in Dos
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |