Is there any chance to exclude folders from windows search with cmd?

Someone 0 Reputation points


Hello, someone genius.

I really want to know this and make a batch file.

A batch file. So I need to know how to exclude folders from windows search with cmd.

At least I want to know if this is possible or not.

Thanks for your answer, genius.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,231 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,091 Reputation points


    Thank you for posting your query.

    Kindly follow the steps provided below to resolve your issue.

    To exclude a specific folder’s contents, along with subfolders and their contents, the path to that folder can be specified with a minus sign as in this example syntax:

    -folder:(C:\Users\Administrator\Desktop\chart graphing)

    If you know that the folder has a unique name within the full area that you are searching, then you can leave off most of the path, as in:

    -folder:(chart graphing)

    If you instead want to permit searching inside of subfolders of such a folder, while still excluding files that are immediately inside of that folder, then use:

    -foldername:(chart graphing)

    You can use multiple instances of the syntax to exclude more than one folder.

    Go to this link for your reference and other troubleshooting procedures

    Do not hesitate to message us if you need further assistance.

    If the answer is helpful kindly click "Accept as Answer" and up vote it.

    0 comments No comments