Search code examples
searchwindows-xp

Windows - Search for Files that Do NOT Contain a Certain Term


How would I search for anything in a certain directory that doesn't contain a certain term?

For example:

!(FINAL)

or

NOT(FINAL)

I would like to find anything (files only) that doesn't contain the term FINAL in the title in Windows XP. Is this possible?

Many thanks.


Solution

  • Windows Command Prompt

    To do this with Windows Command Prompt, CMD.

    Start -> Run -> Type "cmd". use "cd" to change to your working directory and enter:

    dir | findstr /v /i "FINAL"
    

    This will list all files and folders which do not have the word "FINAL" in the title.

    dir /a:-d | findstr /v /i "FINAL"
    

    This will list all files which do not have the word "FINAL" in the title.

    POWERSHELL

    It is possible to do this with Windows PowerShell.

    Get-ChildItem -exclude "*FINAL*"
    

    This will list all files and folders which do not have the word "FINAL" in the title.

    Get-ChildItem -exclude "*FINAL*" | where { ! $_.PSIsContainer }
    

    This will list all files which do not have the word "FINAL" in the title.

    You may need to download and install Windows PowerShell from here if your installation of XP does not already have it. Windows XP Powershell

    Useful Links.