iSumsoft » Resources »Windows 10»How to Find and Delete Duplicate Files in Windows 10 Using CMD

How to Find and Delete Duplicate Files in Windows 10 Using CMD

Isabella Shinn
Isabella Shinn

Updated:

"Hi. My laptop is running slow at times. It takes a minute to boot up and it'll freeze up at times on a webpage. When I try to close the page it doesn't close immediately. I know I have duplicate folders. The issue I'm having is how to identify and delete the RIGHT duplicate files/folders without trashing my laptop. Could someone help me with this? Thanks."

If you have multiple duplicate folders/files on your Windows Computer and want to remove those duplicates, using command can be a good choice. This article will show you how to find and delete duplicate files in Windows 10 using cmd so as to free up and speed up your Laptop/PC.

how to find and delete duplicate files in Windows 10 using cmd

1. Find and Delete Duplicate Files Using CMD in Command Prompt

There are various commands that can help you find and remove duplicate files on Windows. Now, let's see one of them. First of all, press Win +Q and enter cmd in search bar. Next, right-click on Command Prompt and run it as an administrator. Then follow the steps as below.

How to Find duplicate files using cmd

Step 1: In Command Prompt window, type cd /d folder path and press Enter.  Before entering the command, locate the folder you want to scan for duplicate files and copy the file path. Then replace folder path with the copied file path.

set specific location using cmd

Step 3:  Type dir /s /b *.extension and press Enter. Then you will find that the duplicate files are listed in the Command window. Before entering the command, replace extension with the extension of duplicate file you are looking for.

how to find duplicate files using cmd

How to delete duplicate files using cmd

It is worth noting that if you delete duplicate files using del command, the files will be removed from your disk and cannot be retrieved from recycle bin. Now, please follow these steps.

Step 1: In Command Window, set specific location using cmd as step 1 of finding duplicate files.

Step 2: Enter del “* – Copy.png” and hit Enter. Change -Copy.png  into the real file suffix and extension before entering the command. For example, if you want to delete duplicate file with -1 .txt suffix and extension, you need to enter del “* – 1. txt”

how to delete duplicate files using cmd

After that, you can delete those unnecessary duplicate files with the same extension successfully.

2. Find and Delete duplicate files using CMD in PowerShell

In addition to Command Prompt, Windows PowerShell also allows you to automatically find and remove duplicate files using cmd. Here come the steps.

Step 1: Right-click on Start menu and choose Windows PowerShell (Admin) to run Windows PowerShell as administrator.

run Windows PowerShell as administrator

Step 2: Once PowerShell window pops up, enter set-location –path C:\ and hit Enter.

Note: Before entering command, replace C:\ with the drive you want to find duplicate files.

set location

Step 3: To find duplicate files using cmd in Windows PowerShell, enter following command and press Enter.

ls "scan folder" -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group } | Out-File -FilePath "scan result location"

Note: Here scan folder need to be changed into specific folder and scan result location need to be changed into the path where you want to export the list of duplicate files.

find duplilcate files using command

As mentioned above, this command will create a list of duplicate files, and you can delete the duplicate files according to the file path displayed in the list.

open exported list of duplicate files

Step 4: To automatically delete duplicate files using cmd, enter following command and press Enter.

ls "search folder" -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1 } | del

Note: Please replace search folder with specific folder path.

delete duplicate files using command

3. Easier and Safer Way to Find and Delete Duplicate Files

Compared with using cmd to find and delete duplicate files on Windows, using a professional duplicate file finder seems much easier. Here you should definitely have a try on iSumsoft DupFile Refixer. iSumsoft DupFile Refixer is a useful and reliable untility designed to automatically detect and sort out all formats of duplicate files on Windows. Moreover, it can help you mass delete all duplicate files across different files/folders at a time.

Let’s install iSumsoft DupFile Refixer on Windows and learn about how to find and delete duplicate files without using cmd.

Download

Step 1: Launch this duplicate file finder after installing it and click Add icon to select scan folder/drive.

add scan drive/folder to scan for duplicate files

Step 2: After adding the desired drive/folder to scan directory, click Start scanning to automatically check for duplicate files.

click Start scanning

Step 3: When the scanning is completed, iSumsoft DupFile Refixer will create a scan report showing all duplicate files with file name, extension, size and date. It is easy for you to delete all duplicate files in bulk by clicking the box for File Name. If you want to check more details about the duplicate file, just right-click it and choose Open file location.

delete duplicate files in bulk

Extra Tips

iSumsoft DupFile Refixer allows you to customize scan settings to filter scanning items by clicking Settings on the home page.

1. You can check the box for All Types to scan for all kinds of duplicate files including pictures, videos, audio, etc.

2. You are able to Enter minimum size and maximum size to scan for duplicate files in a specific size.

3. You are allowed to skip hidden files, system files, program files and files in recycle bin during scanning.

Once the settings is finished, click OK to save the settings.

customize scan settings in iSumsoft DupFile Refixer

The Bottom Line

Using Command is a good option to find and remove duplicate files on your Windows Computer. But if you are looking for an easier and safer way, it is recommended to use an effective and easy-to-use duplicate file finder like iSumsoft DupFile Refixer which can help you accurately find out and fast delete duplicate files on Windows.