Jump to content

Recommended Posts

Posted

Hi All

 

Looking for a good (and free....) program to find and remove duplicate files from Server? Any recommendations?

 

Thanks

Posted (edited)

Poking around in my bag of tricks yields:

 

workflow Find-Duplicates
{
   [CmdletBinding()]
   param
   (
       [parameter(Mandatory=$True)]
       [string]$Path
   )
   if (!(Test-Path -PathType Container $Path))
   {
       Write-Error "Invalid path specified."
       Exit
   }
   $LogFile="c:\temp\results.csv"
   $CheckpointFile="c:\temp\check.txt"
   Write-Verbose "Scanning Path : $Path"
   $Files=gci -File -Recurse -path $Path | Select-Object -property FullName,Length
   $MatchedSourceFiles=@()
   ForEach ($SourceFile in $Files)
   {
       Write-Verbose "Source : $($SourceFile.FullName)"
       [array]$MatchedSourceFiles=InlineScript
       {
           $MatchedFiles=@()
           $CurrentMatches=$Using:MatchedSourceFiles
           $MatchingFiles=$Using:Files |Where-Object {$_.Length -eq $Using:SourceFile.Length}
           Foreach ($TargetFile in $MatchingFiles)
           {
               Write-Verbose "Checking File $($TargetFile.FullName)"
               ($CurrentMatches | Select-Object -ExpandProperty File) | % {Write-Verbose "List1 : $_"}

               if (($Using:SourceFile.FullName -ne $TargetFile.FullName) -and !(($CurrentMatches |
                    Select-Object -ExpandProperty File) -contains $TargetFile.FullName))
               {
                   Write-Verbose "Matched $($Using:SourceFile.FullName) and $($TargetFile.FullName)"
                   if ((fc.exe /A $Using:SourceFile.FullName $TargetFile.FullName)  -contains "FC: no differences encountered")
                   {
                       Write-Verbose "Match found."
                       $MatchedFiles+=$TargetFile.FullName
                   }
               }
           }
           if ($MatchedFiles.Count -gt 0)
           {
               Write-Verbose "Found Matching Files.  Adding Object."
               $NewObject=[pscustomobject][ordered]@{
                   File=$Using:SourceFile.FullName
                   MatchingFiles=$MatchedFiles
               }

               $CurrentMatches+=$NewObject
           }
           $CurrentMatches
       }
       Checkpoint-Workflow
   }
   $MatchedSourceFiles | Export-CSV $LogFile -NoTypeInformation
}

Edited by Geoff
  • Thanks 1
Posted

A quick search turned this up:

 

Link: RayburnSoft.net - Duplicate Commander 3.2.5448

 

Version 3.0 has multiple known issues, crashes, bugs, etc. The current beta version has progressed a lot since the last stable released over 2 years ago, and I've gotten nothing but positive feedback from it. It is highly recommended that you use the current beta.

 

Duplicate Commander is a freeware application that allows you to find and manage duplicate files on your PC. Duplicate Commander comes with many features and tools that allow you to recover your disk space from those duplicates...

 

System Requirements:

 

Windows 2000SP3/XP/2003/Vista/2008/7/8

256 MB of RAM (1 GB recommended)

Pentium II 500 MHz processor

1 MB of hard drive space

.NET Framework 2.0 (automatically installed on Vista and newer)

 

http://www.rayburnsoft.net/images/dcfull.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...