duplicate files with (2) after name

Hi,

I know how to find duplicate files/folders but was hoping there was a way to search for 2 files with same name except one has (2) at the end? For example:

nonamefile.jpg

nonamefile(2).jpg

I don't know of a way to set CCleaner to do that.

Personally I would use the built-in Windows Command Prompt to find any files with a (2) in the name, and work from there.

If there is a file with a (2) then there is probably one without it.

Open a Command Prompt window and then type the following lines:

cd\

dir /b /s *(2).*</strong>

It will take a few minutes to find all the files.

Explanation:

cd</strong> takes you to your root directory, usually C:\

dir searches for files and folders, I’ve specified two options there: /b tells it to just list the path/filename with no other information, /s tells it to look in all sub-directories.

(2). tells it to look for any filename (and folder name) that contains (2) at the end of the filename.

You can refine that to search just for the filetypes you want.


If I'd just wanted to search for text files I could have used *(2).txt

Typical output will look like this:

image.png

If there are a lot found then you could direct the output to a text file for ease of reading, I'll leave how to do that for you to look up.

Once you have that list of everything ending with (2) you can look for any corresponding file without the (2), it's most likely in the same directory but you could use dir again to check.


eg. from the list above I could:

dir /b /s vote?lizard.txt

to find the pathname, if it exists.


Note the '?' you need to put that in filenames instead of a space when using the Command Prompt.

The Command Prompt is a tool that is often forgotten about these days, but is pretty useful/powerful for stuff like this.

For example here are all the options you can use with a simple command like dir:

https://www.howtogeek.com/363639/how-to-use-the-dir-command-in-windows/