
Finding duplicate files in windows 10 using cmd can fix a surprising number of small problems, and it is a skill worth having — but only if you do the right version of it. The same phrase covers several different actions, and they are not equal. This guide explains finding duplicate files in Windows 10 using CMD step by step, gentlest first, so you can stop as soon as the job is done and never do more than you need to.
The short answer is this: Open Command Prompt and use dir /s /b C:\Users\YourName\Pictures > duplicates.txt to list every file in a folder and its subfolders into a text file you can search. Sort that list and look for the same file name appearing twice — the same name in two folders is the first sign of a duplicate, and the file sizes next to it confirm it. That is the whole job in its simplest form, and the rest of this guide is there for the days when the simple form does not work — when the result is not what you expected, when a setting is in a different menu from the one you expected, or when the version you are using does not have the button you were looking for.
Before you start, take a minute to note what is actually wrong. Is the screen black, is a program refusing to open, or is a setting missing from the menu where you expected it? That answer decides which version of the job you need, and it stops you from doing the strongest version to fix a problem that the gentlest version would have solved in a few minutes.
This guide is written so the steps work as they appear on screen, and the menus are named exactly as they appear, so you can follow them without guessing, and every internal link in the guide goes to a live guide on aafunky.com that covers a related job in the same detail.
Before You Start
Before you start finding duplicate files in Windows 10 using CMD, it helps to know what you are actually doing and why it works. Windows 10 is designed so that the everyday version of this job is quick, while the deeper version is tucked away in the Command Prompt, with dir and certutil, where it cannot be tapped by accident. Knowing which one you need before you start saves you from doing the stronger version when the gentler one would have been enough, and it saves you from repeating the job when the first attempt does not stick.
The first thing to check is the state of the PC itself. Is Windows up to date, is there enough free disk space, and is the thing you want to change actually a setting, a program, or a driver? If the answer is different from what you expected, the steps below still cover both cases, in order, so you can stop as soon as the job is done.
It also helps to have a minute of patience. Most jobs like this fail not because the steps are hard, but because a step is rushed — a menu is closed too soon, or a confirmation is clicked before the screen has finished loading. Go slowly through the steps in this guide, check the screen after each one, and the job will work the first time.
The Main Method, Step by Step
The main method is the one most people should use. Open Command Prompt and use dir /s /b C:\Users\YourName\Pictures > duplicates.txt to list every file in a folder and its subfolders into a text file you can search. That is the whole job in its simplest form, and for most people it is also the whole answer. If it works, you are done, and there is no need to read the rest of this guide, although the troubleshooting section at the end is worth a look if the same problem keeps coming back.
Take the steps one at a time and watch the screen as you go. Sort that list and look for the same file name appearing twice — the same name in two folders is the first sign of a duplicate, and the file sizes next to it confirm it. Windows 10 will give you a clear sign at each stage — a changed setting, a new window, or a confirmation message — and if you do not see that sign, stop and try the step again rather than pushing on. A missed step early on is the most common reason a simple job seems not to work.
When the main method finishes, check the result before you save. To be sure two files are truly identical, compare their hashes: run certutil -hashfile “path\file1.jpg” MD5 and the same for the second file, and matching hashes mean identical contents. If the result is what you expected, the job is done. If it is not, do not repeat the same steps immediately — read the next section first, because the fix is usually a small detail, such as a setting in a different menu, rather than the main method done twice.

The Alternative Method
There is always a second way to do the same job, and it is worth knowing for the days when the main method is awkward. For a whole folder at once, use PowerShell instead: Get-ChildItem -Recurse -File | Get-FileHash | Group-Object Hash | Where-Object Count -gt 1 lists every group of files with the same hash. This method takes a few more steps, but it uses a different route to the same result, which makes it the better choice when the first method does not fit the shape of your data, or when you are showing someone else and want them to see each step clearly.
The alternative method ends in exactly the same place as the main method, so use whichever one feels easier on the day. Delete only one copy of each duplicate, keep the copy in the folder you actually use, and empty the Recycle Bin afterwards — and never delete a file you have not opened first. The result does not remember which method you used, and there is no penalty for choosing the slower one. What matters is that the job finishes cleanly, with the screen showing the result you expected.
If neither method works, the problem is probably not the method at all. Check the basics: is Windows up to date, is the drive nearly full, and is there a driver update waiting in Device Manager? A small check like that fixes more faults than repeating the same method twice.
When the Usual Method Will Not Work
When the normal method cannot work, that is the moment for the fallback in this guide. If CMD feels too slow for thousands of files, use a free duplicate finder such as dupeGuru — it does the same hash comparison with a window to tick the copies to delete, and it is safer than deleting from a text list. This is a safe fallback, and it does not delete your data, although it is not something to use as your everyday method — it is for the days when the usual route is blocked or the result is not what you expected.
After the fallback, give it a minute to settle. Restart the PC and give it a minute to settle. It will show the lock screen, ask for your password or PIN, and then show the desktop. Test the thing that was going wrong, and if it works now, the job is done.
If it still will not work after the fallback and a careful second try, do not keep repeating it. Change the approach: try the job in Safe Mode instead, or check the manufacturer’s support page and describe exactly what happened. Repeating the same steps ten times will not change the result, and a fresh pair of eyes is faster than a tenth attempt.
What to Check Afterwards
Once the main job is done, spend a minute checking the things around it, because a small change can have a side effect you did not expect. For finding duplicate files in Windows 10 using CMD, the most common side effect is something nearby that changed with it — a setting that was reset, a program that was closed, or a driver that needs to be put back. Go through the parts of the PC that matter to you and confirm they are still the way you want them.
It is also worth checking the result after the job. Save your work, restart the PC, and check that the change survived the restart. A result that looks good for ten minutes and then disappears was probably never saved, and a result that survives a restart is one you can trust.
Finally, use the PC normally for a day before you decide whether the job worked. A fix that holds through a normal day of work, with programs opened and closed again, is a fix you can trust. Note what you did, so you can repeat it if the problem ever comes back.

Troubleshooting: When It Does Not Work
Most problems with finding duplicate files in Windows 10 using CMD come down to one of a few simple causes, and they are worth checking in order before you try anything drastic. The first is a recent change: a Windows update, a new driver, or a program you just installed can break something that worked yesterday, and removing or rolling back that change is often the fastest fix. The second cause is disk space. A Windows 10 PC with a nearly full drive will struggle with almost everything, from saving a file to installing an update, and it will often blame the wrong thing. Check Settings, then System, then Storage, and free up space by deleting temporary files or moving large files to another drive. The third cause is a driver. If a device stops working after an update, the driver is the usual suspect, and Device Manager is where you check it.
Before you change anything else, check that you are looking at the right thing. A result that looks wrong is often aimed at the wrong thing — check that the file, drive, or program you wanted was actually the one selected, and that no other window was covering the part you wanted.
If one particular program is always involved when the problem happens, try the same steps in a different program. If it works there, the problem is in that program, not in Windows — and reinstalling that program fixes more faults than reinstalling Windows does.
When This Will Not Fix the Problem
There are times when finding duplicate files in Windows 10 using CMD is the wrong tool for the job, and knowing that saves you an hour. If the problem is hardware — a failing hard drive, a dead DVD drive, a keyboard that does not respond on any computer, or a screen that stays black on every input — no setting, command, or reset will repair it. Those are physical problems, and they need a physical fix, either cleaning, a replacement part, or a repair. The same is true for problems with your account or your network. If a website fails on every device in the house, the fault may be in the router, not the PC.
The same is true for problems with the version you are using. If a setting works on a friend’s PC but not on yours, check the Windows version first in Settings, then System, then About. That one check tells you whether the method or the version is at fault.
Be careful, too, with repeating the same fix over and over. Doing the same steps five times does not make them work better the fifth time, and each attempt costs you time putting things back. One careful attempt, done properly, is the test. If it does not work, change the approach rather than repeating it.
The One Warning to Remember
A warning is worth repeating here, because it is the one people forget. Never delete a duplicate from the Windows folder or Program Files. Two files with the same name in system folders are usually there on purpose, and deleting one can break a program or Windows itself. Read that again before you start, and if you are not sure which version of the job you need, choose the gentler one first. You can always do the stronger version afterwards, but you cannot undo the stronger version once it has run.
If you take one habit away from this guide, make it this: check the result, then save. Too many jobs like this are made worse by fixing a thing that was already fixed, or by changing three things at once and then not knowing which one helped. Change one thing, test it, and only then change the next.
That is the whole approach to finding duplicate files in Windows 10 using CMD: start gentle, use the alternative method when the main one is awkward, keep the fallback for the days when the usual route is blocked, and stop as soon as the job is done. Done that way, it is a short job, and your PC stays exactly the way you want it.
Frequently Asked Questions
Does Windows 10 have a built-in duplicate file finder? No. Windows 10 has no duplicate finder of its own, so you use CMD, PowerShell, or a free tool such as dupeGuru.
What is better for this job, CMD or PowerShell? PowerShell, because it can hash every file in a folder and group the identical ones in a single command, while CMD needs you to check files one by one.
What is a file hash? A hash is a fingerprint of a file’s contents. Two files with the same hash hold exactly the same data, even if their names are different.
Can I find duplicates just by file size? Size is a good first pass — files with the same size and the same name are probably duplicates — but only a matching hash proves two files are identical.
What about duplicate photos? Photos are the most common duplicates. The same hash test works for them, and a duplicate finder will group identical photos even when their file names differ.
Same File, Twice
Finding duplicate files in Windows 10 using CMD starts with a list — dir /s /b into a text file — and ends with a hash check, because only matching hashes prove two files are truly the same.
Delete carefully, one copy at a time, and keep the copy in the folder you actually use. Done that way, you free real disk space without risking a file you still need.
Related guides on aafunky.com: how to check RAM type in Windows 11, how to reset Windows 11 without losing data, how to enable BitLocker in Windows 11, and how to update Windows 7 to Windows 11. Also from Tony Express: How to Get Help in Windows: The Complete Beginner’s Guide and How to Turn On WiFi on Windows 11: A Step-by-Step Guide.