#!/usr/bin/env python3
"""
set_disable_tailored_experiences.py

Disable Tailored Experiences.
Stops Windows from using diagnostic data to personalize tips and ads.

Usage:
    python set_disable_tailored_experiences.py
"""

import winreg


def main() -> None:
    key = winreg.CreateKeyEx(
        winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Privacy", 0, winreg.KEY_SET_VALUE
    )
    winreg.SetValueEx(key, "TailoredExperiencesWithDiagnosticDataEnabled", 0, winreg.REG_DWORD, 0)
    winreg.CloseKey(key)
    print("Disable Tailored Experiences applied.")


if __name__ == "__main__":
    main()