Configure Storage Sense Recycle Bin cleanup threshold: registry value ConfigStorageSenseRecycleBinCleanupThresholdComputerHKLM\Software\Policies\Microsoft\Windows\StorageSense

Policy ID
SS_ConfigStorageSenseRecycleBinCleanupThreshold
Scope
Computer Configuration
Supported on
At least Windows Server 2016, Windows 10 Version 1903
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Category
System › Storage Sense

Registry

ConfigStorageSenseRecycleBinCleanupThreshold

REG_DWORDComputer
Enabled value
Depends on the option value
Element
Minimum age (in days) of a files in the Recycle Bin folder before Storage sense will delete it (0 is never deleting files):
Value type
REG_DWORD
Minimum value
0
Maximum value
365
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\StorageSense]

; Value names and types follow the ADMX. Replace <enter value> below with your own data
"ConfigStorageSenseRecycleBinCleanupThreshold"=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\StorageSense" /v "ConfigStorageSenseRecycleBinCleanupThreshold" /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\StorageSense' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\StorageSense' -Name 'ConfigStorageSenseRecycleBinCleanupThreshold' -PropertyType DWord -Value '<enter value>' -Force | Out-Null