I need to compare 2 folders "A" and "B" and get the list of files and folders newly added or modified.
I tried using Winmerge software but it is not comparing the files present inside the internal folders(so i have to point to each internal folder manually and have to compare)
Is there any way to achieve this.
Click on the “Select Files or Folders” tab in the far left, to start a new comparison. Each comparison you run opens in a new tab. To start a new comparison, click on the “Select Files or Folders” tab in the far left, change the targets and click “Compare” again.
Press the Ctrl and O buttons at the same time or go to File>Open. Under 1st File or Folder, click Browse and select the file or folder. Do the same for the 2nd File or Folder. Click on Compare after both the files or folders are selected.
By default Notepad++ doesn't have compare function. We can make it possible by easily installing a compare plugin after Notepad++ is installed.
The following PowerShell code compares the file listings of two folders. It will detect renamed or newly created files and folders, but it will not detect modified data or different timestamps:
$dir1 = Get-ChildItem -Recurse -path C:\dir1 $dir2 = Get-ChildItem -Recurse -path C:\dir2 Compare-Object -ReferenceObject $dir1 -DifferenceObject $dir2
Source: MS Devblog - Dr. Scripto
How to run a PowerShell script explains how to run the code above in a script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With