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

Solution 1:

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

Solution 2:

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).