Trying to search filenames with special characters in windows explorer (Windows 10)

12,427

I only want the files that have the two inside the brackets (2)

Use the following search expression:

name:~"*(2)*"

Notes:

  • ~ is the literal string indicator and what follows has to match the entire file name

  • Depending on your needs filename: may be better than name:

Before:

enter image description here

After:

enter image description here


Further Reading

Share:
12,427

Related videos on Youtube

Sia
Author by

Sia

Updated on September 18, 2022

Comments

  • Sia
    Sia over 1 year

    Through a very annoying person's mistake, thousands of my files have been copied, often multiple times. This has resulted in thousands of files named filename(2), filename(3), etc.

    My bright idea was to do a search for (2) and delete all the results, but the search keeps showing up all files that have the number 2 in the filename, instead of including the brackets.

    I've tried name:~=(2), "(2)" and even "(2)""(2)" after searching for solutions elsewhere. None of them worked. I want to exclude files that just have a 2 in the filename, I ONLY want the files that have the two inside the brackets.

    Can anyone help, please?

    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style almost 7 years
      So are you looking for a Windows Explorer solution only or would a script solution be sufficient as well?
  • DavidPostill
    DavidPostill almost 7 years
    Why use a complicated PowerShell script when you can do it easily using the Explorer Search functionality?
  • LotPings
    LotPings almost 7 years
    @DavidPostill because of additional functionality? It does ashure to only delete binary equal files.
  • DavidPostill
    DavidPostill almost 7 years
    OK. But that's not what the question asked for :)
  • Sia
    Sia almost 7 years
    I'm afraid I don't know how to use script at all, and David's solution worked for me. But thank you for the help!
  • DavidPostill
    DavidPostill almost 7 years
    @Sia Do you need more help? If this answered your question, please don't forget to accept the answer.
  • Sia
    Sia almost 7 years
    No, thank you, that fixed it! This is just my first time using this site and I didn't know about accepting the answer. Ticked!