Removing duplicate files


  1. Posts : 1
    Win 10 6 bit
       #1

    Removing duplicate files


    I don't trust free duplicate file finders. Is there a way to find and delete duplicate files easily from a folder in Windows 10 that does not require using another program?
      My Computer


  2. Posts : 35,557
    Win 10 Pro (21H2) (2nd PC is 21H2)
       #2

    Well, you could upload files and have their hash computed and do it that way, but that would be gloriously inefficient...
    MD5 File - HTML5 File Hash Online Calculator - MD5, SHA1, SHA2 (SHA-256), SHA-384, SHA-512

    Then you've got music file matching- and specialised programs - just an example where similar (not identical) files might be identified..

    Additional columns in explorer offer nothing useful in this regard.
      My Computers


  3. Posts : 278
    21H1 (OS Build 19043.1081)
       #3

    If I May you could use ccleaner's duplicate finder i use it on my external drive (not C drive) just to weed out most of my junk (my C is only for programs and OS)
      My Computer


  4. Posts : 226
    Many
       #4

    Hashing is a good idea since hash algorthims look at file data and not the meta data. Here is a powershell script I put together which should move all duplicates to a folder called "Duplicates" then you can just delete the folder.
    Code:
    path = "C:\Path\Root\Seach"
    $duplicates = "$path\Duplicates"
    
    
    New-Item $duplicates -ItemType Directory
    
    
    $files = Get-ChildItem -Path $path -File
    
    
    
    
    $fileHashes = @()
    
    
    foreach($file in $files)
    {
        $thisFileHash = Get-FileHash -Algorithm SHA256 -Path $file.FullName
    
    
        if ($fileHashes.Count -eq 0)
        {
            $fileHashes += @($thisFileHash.Hash)
        }
        else
        {
            $isDuplicate = $false
            foreach ($fileHash in $fileHashes)
            {
                if($fileHash -eq $thisFileHash.Hash)
                {
                    $isDuplicate = $true
                    break
                }
            }
            if($isDuplicate)
            {
                Move-Item -Path $file.FullName -Destination "$($duplicates)\$($file.Name)"
            }
            else
            {
                $fileHashes += @($thisFileHash.Hash)
            }
        }
    }
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:12.
Find Us




Windows 10 Forums