⚡ PowerShell 5.1+

Disable Recent Documents History

Stops Windows from tracking recently opened documents.

By WindowsScripting.com · 731 B
Set-DisableRecentDocsHistory.ps1
<#
.SYNOPSIS
    Disable Recent Documents History.

.DESCRIPTION
    Stops Windows from tracking recently opened documents.

    Sets HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer \ NoRecentDocsHistory to 1.

.EXAMPLE
    .\Set-DisableRecentDocsHistory.ps1
#>

[CmdletBinding()]
param()

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

if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}

New-ItemProperty -Path $regPath -Name 'NoRecentDocsHistory' -Value 1 -PropertyType DWord -Force | Out-Null

Write-Host "Disable Recent Documents History applied. Sign out and back in (or restart explorer.exe) for it to fully take effect." -ForegroundColor Green