|
Answer» Hi Guys,
I need to copy a directory form one directory to multiple drives (the drives are external storage devices). After the long surfing i found the MS DOS command "XCOPY C:\ F:\ /E". This command only used, when i move a file form one to one drive, it doesn't used for one to many drives. If any possibilities to copy a file form one drive to many drives. Thanks in Advance..! Simply repeat the command for each desired external drive. Use FOR (I think that's going to become a canned response from me...FOR is all-powerful )
Have a paths.txt file with the destinations listed
type Paths.txt e:\backup f:\backup g:\
for /f "delims=" %g in (paths.txt) do xcopy c:\source %g /e /c /h>>copylog.txt
Remember to double up the % SIGNS if using the above command in a batch file. The copylog.txt file would then show you what was copied.The nice thing about batch files, is that you usually write it once and run it many times, without changes.
So if you're going to copy the contents of a directory to another directory on a different hard drive(s), just sit back, relax and retype the XCOPY line for each drive you're copying to. This might seem like the beginners way to do it, but hey, it works and if a target drive changes, it's very easy to change that one line in the batch file.
I do something similar on my own computer, where I back up all the contents from six different directories on my C: drive to like named directories on my D: drive. XCOPY has to be set up to only copy files that are not already present on the receiving drive. When used as a daily backup routine, the batch file runs in just a few seconds.
Here's just one line from that Backup batch file:
Quote xcopy "C:\MyFiles\*.*" "D:\MyFiles\" /s /y /H /R /D I don't know if this will help you or not....but I do hope so.
Cheers Mate! The Shadow
|