Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need a batch file that can compare the contents of 2 sets of folders (folder#1 and folder#2) by name and then do the following for all files:
If a file exists only in #1 => delete file
if file exists only in #2 => copy this file files to #1
if file (with same name) exists in both #1 and #2 overwrite file in #1 with file from #2, but only if they have different content.Is this possible?
Cheers

If you're using XP this is the wrong forum.
=====================================
Helping others achieve escape felicityM2

maybe:
cd folder1
for %%a in (*.*) do if not exist folder2\%%a del %%a
cd folder2
for %%a in (*.*) do copy /y %%a folder1obv. this does the copy operation regardless of the
file's contents, but if contents are the same, what does
it matter? the copy won't change anything anyway.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |