Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Echo off
- REM https://stackoverflow.com/questions/17599576/comparing-two-folders-and-its-subfolder-batch-file
- SetLocal EnableDelayedExpansion
- Set "Folder1=E:\test it"
- Set "Folder2=E:\test it 2"
- echo(>dirdiff1.log
- echo(>dirdiff2.log
- (For /R "%Folder1%" %%x In (*.*) Do (
- Set "FullPath=%%x"
- Set "RelPath=!FullPath:%Folder1%=!"
- If Exist "%Folder2%!RelPath!" (
- >Nul 2>&1 FC /b "%Folder1%!RelPath!" "%Folder2%!RelPath!" && (
- REM Echo Dup - %%x
- )||(
- Echo Dif - %%x
- )
- ) Else (
- Echo New - %%x
- )
- )
- ) > dirdiff1.log
- (For /R "%Folder2%" %%x In (*.*) Do (
- Set "FullPath=%%x"
- Set "RelPath=!FullPath:%Folder2%=!"
- If Not Exist "%Folder1%!RelPath!" (
- Echo New - %%x
- )
- )
- ) > dirdiff2.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement