Configure Windows Search Index Exclusions via Regedit
This guide explains how system administrators can configure default
search indexing exclusion paths across all drives using the Windows
Registry Editor (regedit). Modifying these settings allows
you to prevent the Windows Search service from scanning specific
folders, temporary directories, or sensitive drives across an entire
environment, optimizing disk performance and resource usage.
Step 1: Open the Registry Editor
- Press
Win + Rto open the Run dialog box. - Type
regeditand pressCtrl + Shift + Enterto launch the Registry Editor with administrative privileges. - If prompted by User Account Control (UAC), click Yes.
Step 2: Navigate to the Windows Search Registry Key
To enforce search exclusions system-wide via administrative policies, navigate to the following path in the left pane:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search
Note: If the Windows Search key does not exist under
\Microsoft\Windows, right-click on Windows,
select New > Key, and name it
Windows Search.
Step 3: Configure Default Excluded Paths
You can exclude specific paths by configuring policy strings within this key:
- Right-click on the
Windows Searchkey in the left pane. - Select New > Multi-String Value (or String Value if defining a single path).
- Name the new value
PreventIndexingPathsorDefaultExcludedPaths. - Double-click the newly created entry to edit its data.
- Enter the target directories you want to exclude across drives, placing each path on a new line:
C:\Temp\*
D:\SensitiveData\*
*:\Cache\*
Note: Wildcards (such as *:\) can be used to apply
exclusions to all drive letters on the system.
Step 4: Configure Gatherer-Level Exclusions (Alternative Method)
For direct control over the Windows Search service default catalog without using policies, navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gather\Windows\SystemIndex\Sites\LocalHost\DefaultExcludedPaths
- Right-click in the right pane and select New > String Value.
- Set the Value name as the file URL syntax for the
path you wish to exclude (e.g.,
file:///C:\[PathToExclude]\). - Set the Value data to
1(or leave empty depending on the service build).
Step 5: Restart the Windows Search Service
For the registry modifications to take effect, restart the indexing service:
- Open Command Prompt as an Administrator.
- Run the following commands sequentially:
net stop "Windows Search"
net start "Windows Search"The Windows Search indexer will now ignore the specified paths across all designated drives during subsequent indexing operations.