Stop indexing in the event of limited hard drive space: registry value PreventIndexingLowDiskSpaceMBComputerHKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search

Policy ID
StopIndexingOnLimitedHardDriveSpace
Scope
Computer Configuration
Supported on
Microsoft Windows XP, Windows Server 2003 with Windows Search version 3.01, or 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

PreventIndexingLowDiskSpaceMB

REG_DWORDComputer
Enabled value
Depends on the option value
Element
MB Limit
Value type
REG_DWORD
Maximum value
2147483647
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]

; Value names and types follow the ADMX. Replace <enter value> below with your own data
"PreventIndexingLowDiskSpaceMB"=dword:<enter value>
CMD
:: Value names and types follow the ADMX. Replace <enter value> below with your own data

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "PreventIndexingLowDiskSpaceMB" /t REG_DWORD /d "<enter value>" /f
PowerShell
# Value names and types follow the ADMX. Replace <enter value> below with your own data

New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Name 'PreventIndexingLowDiskSpaceMB' -PropertyType DWord -Value '<enter value>' -Force | Out-Null