Please see if resetting Windows Search using this batch file helps. → reset_wsearch.bat
Download the file, right-click on it and choose "Run as administrator."
Note: It also resets the search index.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i have a windows 11 pc(23h2) and i'm trying to delete exclude folders in search indexer.
there is so many excluded folders in list such as cloned github repo, node_modules.
also deleting one or more will crash settings and it's not removed. plz help.
Please see if resetting Windows Search using this batch file helps. → reset_wsearch.bat
Download the file, right-click on it and choose "Run as administrator."
Note: It also resets the search index.
Hello. Do you recall installing any third-party search tools or using registry cleaners in the past? That could explain why the exclusions became locked or corrupted.
You can reset everything (exclusions, index database, config) back to default using this PowerShell script. It bypasses the broken GUI and directly clears both the index data and registry entries:
# Stop Windows Search Service
Stop-Service -Name WSearch
# Delete the current search index database and configuration
Remove-Item -Path "$env:ProgramData\Microsoft\Search\Data\Applications\Windows" -Recurse -Force
Remove-Item -Path "$env:ProgramData\Microsoft\Search\Data\Temp" -Recurse -Force
# Optional: Reset registry exclusions (set back to defaults)
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Search\Gather\Windows\SystemIndex\Sites\LocalHost" -Name "DefaultGatherPolicy" -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows Search\Gather\Windows\SystemIndex\Sites\LocalHost\Paths" -Recurse -Force -ErrorAction SilentlyContinue
# Start Search Service
Start-Service -Name WSearch
This will fully wipe the Search Indexer state and restore clean defaults. After a reboot, Windows will begin reindexing only the standard folders. If any exclusions still reappear, it means they’re being pushed by a policy or a background process.
Let me know what happens after running this.