1

In Windows 10 version 1909 you can exclude folders from Windows search by going in:

Settings > Searching Windows > Excluded Folders

and add the excluded folders one by one.

enter image description here

As a result of that, all the files and folders contained in those folders (recursively) will be excluded from the search done in the Windows Start Menu.

What is the PowerShell command to add one folder to the Windows Search Excluded Folders?

1 Answers1

1

The Windows 10 Search parameters may be found in the registry under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules.

They are stocked in sub-keys named 0, 1, 2 etc.

As the items under each key are not documented, I would use templates.

Here is one a screenshot of one exclusion for the folder of C:\Temp\PrintScreen:

enter image description here

This uses a weird URL of :
file:///C:\[bac78df2-ab37-4a4c-ba64-d7d57071563b]\Temp\PrintScreen\.

However, most sources I have found claim that it also accepts URLs that are written more simply. In that case, this would look like file:///C:\Temp\PrintScreen\.

As Windows Search is disabled on my computer, you will need to test. If it works, then a PowerShell script would be easy to write, with the only problem being finding the next available number for a sub-key.

It would perhaps be useful to stop the Windows Search system service while this registry update is done.

harrymc
  • 498,455