⚡ PowerShell 5.1+

Check "Disable Recent Documents History" Status

Reads the current registry value behind the "Disable Recent Documents History" tweak so you can confirm whether it's applied.

By WindowsScripting.com · 832 B
Test-DisableRecentDocsHistoryStatus.ps1
<#
.SYNOPSIS
    Checks whether "Disable Recent Documents History" is currently applied.

.DESCRIPTION
    Reads HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer \ NoRecentDocsHistory and reports its current value,
    or reports that it isn't set (falling back to the Windows default).

.EXAMPLE
    .\Test-DisableRecentDocsHistoryStatus.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'

$value = Get-ItemProperty -Path $regPath -Name 'NoRecentDocsHistory' -ErrorAction SilentlyContinue

if ($null -eq $value) {
    Write-Host "'NoRecentDocsHistory' is not set at $regPath (using the Windows default)." -ForegroundColor Yellow
} else {
    Write-Host "Current value of 'NoRecentDocsHistory': $($value.'NoRecentDocsHistory')" -ForegroundColor Green
}