🐍 Python 3.10+
Disable Recent Documents History (Python)
Stops Windows from tracking recently opened documents. Applies the tweak via the stdlib winreg module.
set_disable_recent_docs_history.py
#!/usr/bin/env python3
"""
set_disable_recent_docs_history.py
Disable Recent Documents History.
Stops Windows from tracking recently opened documents.
Usage:
python set_disable_recent_docs_history.py
"""
import winreg
def main() -> None:
key = winreg.CreateKeyEx(
winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", 0, winreg.KEY_SET_VALUE
)
winreg.SetValueEx(key, "NoRecentDocsHistory", 0, winreg.REG_DWORD, 1)
winreg.CloseKey(key)
print("Disable Recent Documents History applied.")
if __name__ == "__main__":
main()