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

  1. Press Win + R to open the Run dialog box.
  2. Type regedit and press Ctrl + Shift + Enter to launch the Registry Editor with administrative privileges.
  3. 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:

  1. Right-click on the Windows Search key in the left pane.
  2. Select New > Multi-String Value (or String Value if defining a single path).
  3. Name the new value PreventIndexingPaths or DefaultExcludedPaths.
  4. Double-click the newly created entry to edit its data.
  5. 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
  1. Right-click in the right pane and select New > String Value.
  2. Set the Value name as the file URL syntax for the path you wish to exclude (e.g., file:///C:\[PathToExclude]\).
  3. 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:

  1. Open Command Prompt as an Administrator.
  2. 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.