How can I find all folders in Folder A that does not exist in Folder B?

2

I have lots of folders in D:\FolderA and at some point most (but not all) of the folders where copied to D:\FolderB. What is the best way to list all the "missing" folders in FolderB?

Espo

Posted 2011-01-25T06:36:09.170

Reputation: 294

Answers

2

If you're on Windows XP, you can use Windiff.exe utility to compare two directories.

Another alternative is to use WinMerge which is an open-source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle. Below are some screenies.

Folder Comparison Results:

Folder Comparison Results

Folder Compare Tree View:

Folder Compare Tree View

Mehper C. Palavuzlar

Posted 2011-01-25T06:36:09.170

Reputation: 51 093

Thank you for your tip on WinMerge. Didn't know it could do that :) – Espo – 2011-01-25T12:28:52.683

1

This should be easy enough in PowerShell.

Aim: Get a list of all the sub-folders of folder $SourceFolder for which a folder with the same name does not exist under folder $DestFolder. Put the following in a script file:

param([string]$SourceFolder, [string]$DestFolder)

Get-ChildItem $SourceFolder| Where-Object { $_.PSIsContainer -and -not (Test-Path ( Join-Path $DestFolder$_.Name ))}

The output can then be saved into a file or further processed (eg. to create a script to copy the missing folders).

Richard

Posted 2011-01-25T06:36:09.170

Reputation: 8 152