0

Within windows explorer. Happy to use cmd prompt/powershell if need be.

I have folder A, signified with A:1,2,3 (1,2,3 being different file names within folder A)

Folder B B:1,2,3,4,5,6

So files 1,2,3 are located in both folders.

Am I able to "Subtract Folder A from B" hence B:4,5,6 and no longer containing 1,2,3 (duplicate files)

Sorry if not explained well

I am comparing individual files, not a list of files in 1 text file (for duplicate question)

Vomit IT - Chunky Mess Style
  • 40,038
  • 27
  • 84
  • 117
Jayden
  • 111
  • 5
  • I can't understand if it have to be done using the file's name or you have to be sure and calculate the checksum for every file in order to understand If the content is the same – alessiosavi Sep 24 '19 at 06:54
  • Don't need to worry about file names. I have a list of files in folder A. The files in folder B are duplicates of some in A, and I want to remove these duplicates from A, to ensure A and B are unique (no duplicate files) – Jayden Sep 24 '19 at 06:56
  • Possible duplicate of [How to delete files from a folder using a list of file names in windows?](https://superuser.com/questions/355584/how-to-delete-files-from-a-folder-using-a-list-of-file-names-in-windows) – harrymc Sep 24 '19 at 07:33

2 Answers2

1

Within windows explorer. Happy to use cmd prompt/powershell if need be.

Are you open to applications? If so, I can recommend, from experience, Free Duplicate File Finder.

KEY FEATURES

Powerful search engines (byte by byte and SHA-1)
Find files with same contents, same name and zero size.
Find duplicate pictures, videos, songs (mp3, wma, ogg).
Fastest among duplicate file finders and duplicate file cleaners.
Works with removable media devices like pendrives, external hard disks, etc.
Search local PC and over network.

Identify and recover wasted disk space
Reducing the time and media used for backups
Minimize time used to unneeded virus scanning
Increase free space on "limited" resources, like laptops and memory disks
Reduce files searching time

enter image description here

If you don't like that (although I can't imagine why not), ask us for another solution on software recommendations

0

PowerShell Option:

-whatif included --- remove to execute

$FolderA = 'c:\Folder\A'
$FolderB = 'c:\Folder\B'

(Get-ChildItem -Path $FolderA -file).Name |
      Remove-Item "$FolderB\$_" -whatif
   }

Compact version:

(gci 'c:\Folder\A' -file).Name | %{ri "c:\Folder\B\$_"}
Keith Miller
  • 8,704
  • 1
  • 15
  • 28