Author: Melky Warinak
Organisation: My IT Solutions (PNG)
Website: myitsolutionspg.com
A PowerShell + graphical tool for safely detecting, reviewing, and removing duplicate files using size grouping and SHA-256 content hashing. Designed for large folders, archives, OS images, and file servers.
This tool helps you:
- Detect duplicate files reliably
- Decide which copies to KEEP and which to REMOVE
- Review results visually before deleting
- Export full audit CSVs for compliance and rollback
- Safely delete files (Recycle Bin supported)
- Quarantine files instead of deleting them
It is intended for administrators, IT support, and power users.
The solution consists of two scripts:
| File | Purpose |
|---|---|
MITS-DuplicateFileFinder-GUI.ps1 |
WPF GUI front-end |
Find-DuplicateFiles.ps1 |
Backend scanning & hashing engine |
The GUI calls the scanner script during execution.
- Windows PowerShell 5.1+
- .NET Framework (default on Windows)
- NTFS file system recommended
- Sufficient permissions to read/delete target files
powershell -ExecutionPolicy Bypass -File .\MITS-DuplicateFileFinder-GUI.ps1The interface is divided into four main sections:
- Scan Configuration
- Scan & Action Controls
- Results Grid
- Logs & Audit Trail
Textbox:
Path to the folder or drive you want to scan.
Buttons:
- Browse… – Select a folder using a dialog
- Open Output Folder – Opens the output directory containing logs and CSVs
✅ Recurse
- When enabled, scans all subfolders
- When disabled, scans only the selected folder
Recommended: Enabled
✅ ConfirmContent (SHA256)
- Performs SHA-256 hashing
- Confirms files are bit-for-bit identical
- Prevents false positives (same name/size but different content)
Impact: Slower scan, higher accuracy
Recommended: Enabled
✅ ConfirmedOnly
- Shows only duplicates that passed hash confirmation
- Hides unconfirmed size-based matches
Recommended: Enabled for safety
⬜ IncludeHidden/System
- Includes hidden and system files (e.g. OS files)
- Disabled by default to reduce risk
⚠️ Use with caution
Controls what appears in the Results grid:
- ALL – Show all duplicate candidates
- REMOVE – Show only files marked for removal
- KEEP – Show only files marked to keep
Useful for review before actions.
Dropdown determining which duplicate copy is kept automatically. The selected rule determines the KEEP / REMOVE classification inside each duplicate group.
| Rule | What it keeps | Notes |
|---|---|---|
| ShortestPath | The file with the shortest full directory path | Good default; tends to keep the “closest”/cleanest path |
| LongestPath | The file with the longest full directory path | Useful when you want to keep the most deeply nested copy |
| NewestWriteTime | The file with the most recent LastWriteTime | Keeps the most recently modified file |
| OldestWriteTime | The file with the oldest LastWriteTime | Keeps the earliest/legacy copy |
| NewestCreationTime | The file with the most recent CreationTime | Keeps the newest created file |
| OldestCreationTime | The file with the oldest CreationTime | Keeps the oldest created file |
- Minimum file size (in MB) to include
- Files smaller than this value are ignored
Default:0(include all)
- Limits how many REMOVE paths are sampled per duplicate group
- Used for reporting and safety previews
Starts the duplicate scan using current settings.
The progress bar updates while scanning.
Automatically selects all rows marked as REMOVE in the results grid.
Used before delete or quarantine.
Clears all selected checkboxes.
Simulates delete actions:
- Logs what would be deleted
- No files are actually removed
Recommended for first runs.
- Sends files to the Recycle Bin (allows recovery)
- If unchecked, files are permanently deleted.
Moves selected files to a quarantine folder instead of deleting.
Useful for cautious cleanup or audits.
Deletes selected files based on:
- WhatIf setting
- Recycle Bin setting
This is the most important part of the tool.
- Auto-resizes vertically with the window
- Vertical scrollbar always visible when needed
- No horizontal scrollbar (by design)
- Long values are handled safely (see below)
| Column | Description |
|---|---|
| Select | Checkbox for actions |
| Confidence | Confirmed / Unconfirmed |
| Action | KEEP or REMOVE |
| SizeMB | File size |
| Name | File name |
| FullPath | Full file path |
| KeepPath | Path of the kept copy |
| GroupId | Duplicate group identifier |
| FullHash | SHA-256 hash |
Text Filter
- Filters results in real time
- Matches against visible columns
- Useful for searching filenames, paths, or hashes
Clear (X) Button
- Clears the filter instantly
Displays real-time execution logs including:
- Scan start/end
- Files enumerated
- CSV export paths
- WhatIf actions
- Deletions and quarantine moves
This acts as a live audit trail.
All outputs are written to the out directory:
| File | Purpose |
|---|---|
duplicates_confirmed_keepremove_*.csv |
Full detailed audit |
duplicates_summary_*.csv |
Summary report |
gui_log_*.txt |
GUI execution log |
- Enable:
- ConfirmContent (SHA256)
- ConfirmedOnly
- WhatIf (Dry run)
- Run Scan
- Review Results Grid
- Review Summary CSV
- Disable WhatIf
- Use Move to Quarantine first
- Finally, use Delete Selected
- Emphasis on readability and safety
- CSV files act as the authoritative record
- GUI focuses on decision-making, not raw data dumping
This tool can move or delete files. Always review CSV outputs and test with WhatIf mode first.
My IT Solutions (PNG) and the author are not liable for data loss due to misuse.
