Merging 2 directories

D

DJ

All,

We have 2 domains that have a similar file directory
share. Lets call it c:\share. On both domains, the file
share have similar and dissimilar files. We are merging
the 2 domains together at this point and need to merge the
C:\share from both domains. I have about 5 gigs of data in
each. I need to merge them together, with out overwritting
each others files (similar files that exist on each
domain), but while also adding the new files from the
other domain (dissimilar files). Is there some kind of
tool that can assist me in this? This is very important, I
dont wanna do this incorrectly.

Thanks.

DJ
 
J

Jerold Schulman

All,

We have 2 domains that have a similar file directory
share. Lets call it c:\share. On both domains, the file
share have similar and dissimilar files. We are merging
the 2 domains together at this point and need to merge the
C:\share from both domains. I have about 5 gigs of data in
each. I need to merge them together, with out overwritting
each others files (similar files that exist on each
domain), but while also adding the new files from the
other domain (dissimilar files). Is there some kind of
tool that can assist me in this? This is very important, I
dont wanna do this incorrectly.

Thanks.

DJ


You can script it.

I am going to assume that the two shares have identical folder trees.
If not, make them identical. Then

@echo off
setlocal
set fromsrv=\\Server1
set tosrv=\\Server2
set from=%fromsrv%\SourceShare
set to=%tosrv%\DestShare
for /r %from% %%f in (*.*) do set fromline=%%f&call :merge
endlocal
goto :EOF
:merge
call set dest=%%fromline:%fromsrv%=%tosrv%%%
if exist "%dest%" goto :EOF
copy "%fromline%" "%dest%"



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
M

Michael Bednarek

All,

We have 2 domains that have a similar file directory
share. Lets call it c:\share. On both domains, the file
share have similar and dissimilar files. We are merging
the 2 domains together at this point and need to merge the
C:\share from both domains. I have about 5 gigs of data in
each. I need to merge them together, with out overwritting
each others files (similar files that exist on each
domain), but while also adding the new files from the
other domain (dissimilar files). Is there some kind of
tool that can assist me in this? This is very important, I
dont wanna do this incorrectly.

Similar and dissimilar are rather difficult concepts for a humble copy
operation; identical and different file names would be a clearer
distinction.

You might want to look at XCOPY (see XCOPY /?) or RoboCopy; see:
<http://www.techieville.com/vb/showthread.php?s=&threadid=15> and
<http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top