views:

40

answers:

1

What should I write into the .bat file for it to find all files with same names in folder (and it's sub folders) and replace them with file from another file (from another folder)?

Is there any fast way if we have 1 000 000 folders with nearely 10 000 files for replacement?

+1  A: 

Try

XCOPY /U

/U will make it only copy files from the source to files in the destination, it won't copy any files that do not already exist (which is what I think you are asking for).

To copy files with the same names from c:\weebles to c:\wobble you would do

XCOPY c:\weebles c:\wobble /U /Y

Specify /U to only copy files that already exist in the destination Specify /Y to copy without asking your permission to overwrite each file (will get tedious really quick).

For more info, open a command prompt and type

help xcopy

IMPORTANT: Before you try this (or a variant) do either:

  • A backup of your destination folder
  • A test on some folders that don't matter

Would be a shame to go all gung ho, start the copy then regret it! :-)

Stephen Kellett