Prevent indexing certain paths: registry value PreventIndexingCertainPaths_2 (HKCU Windows Search)UserHKCU\SOFTWARE\Policies\Microsoft\Windows\Windows Search
- Policy ID
- PreventIndexingCertainPaths_2
- Scope
- User Configuration
- Supported on
- Any version of Microsoft Windows with Windows Search 4.0 or later
- Source
- Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
- Category
- Windows Components › Search
Registry
(list values)
REG_SZUser- Enabled value
- Depends on the option value
- Element
- Prevent Indexing Certain Paths
- Value type
- REG_SZ
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Windows Search\PreventIndexingCertainPaths] "<enter value>"="<enter value>"
CMD
reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\Windows Search\PreventIndexingCertainPaths" /v "<enter value>" /t REG_SZ /d "<enter value>" /f
PowerShell
New-Item -Path 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\PreventIndexingCertainPaths' -Force | Out-Null New-ItemProperty -Path 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\PreventIndexingCertainPaths' -Name '<enter value>' -PropertyType String -Value '<enter value>' -Force | Out-Null