0% found this document useful (0 votes)
64 views

How To Find and Remove Duplicate Files On Windows

This document provides instructions for finding and removing duplicate files on Windows using either File Explorer or Windows Powershell. The File Explorer method involves searching by file extension and manually deleting duplicates. The Powershell method uses scripts to automatically find all duplicate files regardless of extension, export their locations to a text file, and optionally delete the duplicates.

Uploaded by

wilkesgillingham
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

How To Find and Remove Duplicate Files On Windows

This document provides instructions for finding and removing duplicate files on Windows using either File Explorer or Windows Powershell. The File Explorer method involves searching by file extension and manually deleting duplicates. The Powershell method uses scripts to automatically find all duplicate files regardless of extension, export their locations to a text file, and optionally delete the duplicates.

Uploaded by

wilkesgillingham
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

How to find and remove

duplicate files on Windows


LAST UPDATED: NOV 18, 2020

Duplicate files do nothing but clutter up your drive, make your PC run slower, and increase the
difficulty level significantly when it comes to finding the right version of a specific file: is it the
one I just updated, or the other one?

Find and remove duplicate files using


Windows File Explorer
1. On the lower-left corner beside the Windows icon, enter Indexing Options on the
search bar and then click Indexing Options. This will open the Indexing Options setting
on a new window.

2. Click Modify, and then select Show all locations.


A pop-up will appear to ask for your login details. Make sure that you are using an
administrator account when doing any modification using this setting.

3. Check if all of the boxes are ticked under the Changed selected locations section.
If yes, click OK, and then click the Close button. If not, tick all the boxes.
4. On your keyboard, press the Windows + E keys to open the File Explorer. This will
open the File Explorer on a new window.

It is easier to find your files under your user account. To open user account, go to
Windows (C:)

, then select Users folder.

5. On the upper-right corner, click Search, and then enter the following extensions based on
their format:
IMAGES
.jpg,.jpeg, .png or .gif

VIDEOS
.flv,.mov,.avi,.wmv,.mp4 or .3gp

MUSIC
.mp3,.wav or.wma

MICROSOFT
WORD .doc or.docx

MICROSOFT
POWERPOINT .ppt or .pptx

MICROSOFT
EXCEL .xls or .xlsx

PDF FILE
.pdf

TEXT FILE
.txt

EXECUTABLE
PROGRAMS .exe

6. Sort the search results by Name:


a. Click the View tab.
b. Under the Panes section, select Preview pane.
c. Under the Layout section, select Details.
d. Under the Current view section, click Group by, and then select Name.
e. To arrange the files in ascending order, click Group by, and then
select Ascending.
7. Check for the duplicate files that are saved in different locations. Check the Date
modified column to know which files you have the latest version.
8. After checking the files, select the file you want to delete, and then press DELETE on
your keyboard.

Find and remove duplicate files using


Windows Powershell
Windows Powershell is a tool to manage your Windows operating system. To use this, do the
following:

1. On the lower-left corner, right-click on the Windows icon, and then select Windows
PowerShell (Admin). This will open the Windows Powershell on a new window.
A pop-up confirmation window will appear. Click Yes to proceed.

2. Enter this script: set-location –path C:\ in the Windows Powershell window.

3. Enter the script for the list of all duplicates and their location:
ls "(directory you want to search)" -recurse | get-filehash | group -
property hash | where { $_.count -gt 1 } | % { $_.group } | Out-File -
FilePath "(location where you want to export the result)"

In (directory you want to search), enter the folder location of your User Account.

In (location where you want to export the result), enter the folder location you want the
result to be exported or saved (e.g. Documents or Desktop).
4. After entering the script, there would be two results that will appear:
 With error:

This error message means that the searching of files is still on-going.

 Without error:

This message means that the searching of files is done.

5. Open the folder location you have exported or saved.


6. Check for each location in the text file, and then delete the duplicate files.

By using Windows Powershell, it will search and display all of the duplicate files
regardless of their extension format (e.g. .mp3, .png or .txt).

7. Enter this script to automatically delete all duplicate files on the Windows Powershell
window:
ls "(directory you want to search)" -recurse | get-filehash | group -
property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1
} | del

In (directory you want to search), enter the folder location of your User Account.
To view all files to be deleted, you may change the del to Out-File -FilePath (in
FilePath, enter the folder location you want to export or save the result file.)

You might also like