Finding duplicate files in Windows 10 using Command Prompt (CMD) can be a real game-changer, especially when your disk space is getting tight but you don’t want to fuss with third-party tools. The thing is, Windows doesn’t have a one-click duplicate finder in CMD, but with a little effort, you can at least spot the same file sizes or contents by listing everything and doing some manual checks. It’s not perfect — sometimes you might miss something or get false positives — but it’s satisfying to know you’re making a dent in your clutter without extra software. Plus, it’s a neat way to get more familiar with command-line magic, even if it’s not 100% foolproof. So yeah, here’s the low-down on how to do it without breaking a sweat, or at least, minimizing the frustration.
How to Find Duplicate Files in Windows 10 using CMD
Picking through those duplicate files manually isn’t exactly fun, but it’s doable if you know where to look. This plan is more about controlling what you delete — focusing on file size and name comparisons — and less about 100% automation. Expect to spend a bit of time, especially if you got thousands of files, but it’s worth it if you want to clean up without extra tools. Also, be aware — sometimes Windows just makes this harder than needed, so patience is key. If after trying this, nothing seems right, maybe a dedicated duplicate cleaner like CloneSpy or Duplicate Cleaner might be worth considering.
Open Command Prompt and locate your folder
First off, hit Start, type “cmd”, and open it. No need for admin rights here unless you’re messing with system folders (which I wouldn’t recommend unless you know what you’re doing).When it’s up, you’ll want to go to the folder where your files live. That’s done with the cd
command. For example, if your files are in Documents\MyFolder, type:
cd C:\Users\YourName\Documents\MyFolder
This tells CMD to focus right there. Easy enough, but make sure you get the path right or it won’t work. Sometimes, using tab autocomplete helps (just start typing and hit Tab).
Generate a list of all files in that folder
Here’s where things get interesting. You want a full list of your files, including subfolders, so you get the complete picture. The command is:
dir /s /b > filelist.txt
This outputs all files with their paths into `filelist.txt`, just like taking a snapshot of your folder. The /s makes it include subdirectories, and /b gives a clean, bare format — no extra info. After running it, you’ll see the file in your current folder. Now, you can open it in Notepad or any text editor to start scouting for duplicates.
Compare files based on size and name
This part is a bit manual, but it’s straightforward. Open filelist.txt
; scroll through and watch for files that look suspiciously similar — same size or filename tips you off. Not perfect, but if two files share the same size and name, chances are they’re duplicates. To double-check, you can use the fc
command for a quick file comparison or script some batch to match names and sizes automatically, but that’s more advanced.
Example: If you see photo1.jpg in two places, both 2MB, you might have a duplicate. But be cautious because different versions could have same size. The more reliable way is to compare their contents, which gets complicated quickly and is where dedicated tools shine.
Deleting the duplicates carefully
When you’re confident a file is a duplicate, delete it. Just mind — you’re not going to get it back from Recycle Bin, so double-check before hitting Yes. Use:
del "path\to\file"
to delete the file directly from command line. Because of course, Windows has to make it harder than just drag/drop from Explorer. On some setups, even moving files to the Recycle Bin via CMD requires additional steps or third-party scripts, so be extra careful.
After all that, your storage should be a bit freer, and you can breathe a little easier knowing you manually combed through some duplicates without extra fuss.
Tips for Finding Duplicate Files in Windows 10 using CMD
- Back up your important stuff first — accidental deletes are a pain.
- Use
tree
command if you want a visual directory breakdown, liketree /f
. - Check the last modified date if you’re unsure — newer files might be safer to keep.
- Explore the
fc
command for comparing contents of two specific files if needed. - Don’t forget to run this periodically — clutter adds up fast!
Frequently Asked Questions
Can I automate this with a script?
Sort of. You can write batch scripts that look for files with the same size or name, but for smarter comparison, dedicated tools are usually better. Still, on some setups, a little automation helps if you’ve got lots of repetitive cleanup.
What if I delete the wrong file?
Just keep in mind, deletes via CMD bypass the Recycle Bin. If you’re worried, run a backup or create a system restore point beforehand. Once gone, recovery is possible but not guaranteed, and it’s not as simple as hitting Undo.
Is there a faster way if I really hate manual work?
Yes, third-party apps like Duplicate Cleaner or CloneSpy will scan and compare files much quicker, with more options. On one hand, those tools save time, but if you prefer working inside Windows and don’t mind some patience, this CMD method still works.
Will this work on Windows 11 too?
Definitely. CMD is still a thing in Windows 11, so the same commands apply, though the interface might look a little different. Just remember, the core workflow doesn’t change.
How do I see hidden files in CMD?
Use dir /a
to list all files, including hidden ones. If you suspect duplicates are hidden, this makes sure you spot everything.
Summary
- Open Command Prompt and go to your target folder
- Run
dir /s /b > filelist.txt
- Check the list for files with matching size or names
- Delete duplicates carefully with
del
Wrap-up
While it’s not the most polished way, manually hunting down duplicate files with CMD can make a dent in your storage woes. Sure, it’s a bit tedious, but it’s also pretty satisfying when you see the space freed up. If nothing else, it’s a good way to learn a little more about how your PC’s file system really works. Fingers crossed this helps someone avoid piling up more junk in the future — and maybe makes you appreciate how much easier things are with dedicated software. Either way, this method works for those who want control, no extra apps necessary.