Rebuild Search Index Path Using Regedit
This guide explains how to change the Windows Search catalog data
path and trigger a complete index rebuild directly through the Windows
Registry Editor (regedit). Modifying the index path via the
registry is useful when the Windows Search service fails to rebuild
through the standard Control Panel interface, when you need to recover
from catalog corruption, or when you want to migrate search index files
to a different drive to save space.
Step 1: Stop the Windows Search Service
Before editing registry keys related to indexing, you must stop the search service to prevent file locks or data corruption.
- Press
Win + R, typeservices.msc, and press Enter. - Scroll down to locate Windows Search.
- Right-click Windows Search and select Stop.
Alternatively, open Command Prompt as an administrator and run:
net stop wsearchStep 2: Modify the Catalog Path in Registry Editor
Press
Win + R, typeregedit, and press Enter to open the Registry Editor.In the address bar at the top, navigate to the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows SearchIn the right pane, locate the string value named DataDirectory.
Double-click DataDirectory to edit its value.
In the Value data field, enter the full path where you want the search catalog to be stored (for example,
D:\SearchIndex\or the default location%ProgramData%\Microsoft\Search\Data\).Click OK to save the changes.
Note: Ensure the target directory exists and has appropriate
read/write permissions for the SYSTEM and
Administrators groups.
Step 3: Trigger a Catalog Reset and Rebuild
To force Windows Search to treat the catalog as new and initiate a clean rebuild in the specified location:
- Stay in the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Searchregistry key. - Look for the DWORD (32-bit) value named SetupCompletedSuccessfully.
- Double-click it and change its Value data from
1to0. - Click OK.
Setting this value to 0 tells Windows that initial
search setup is incomplete, forcing the service to recreate the search
catalog database from scratch in the path specified by the
DataDirectory key upon its next startup.
Step 4: Restart the Windows Search Service
Open Command Prompt as an administrator.
Run the following command:
net start wsearchWindows Search will now initialize, create the database files (such as
Windows.edb) in your new catalog path, and automatically rebuild the index in the background.