🐍 Python 3.10+
Check "Disable Cortana" Status (Python)
Reads the registry value behind the "Disable Cortana" tweak via winreg to confirm whether it's applied.
check_disable_cortana_status.py
#!/usr/bin/env python3
"""
check_disable_cortana_status.py
Checks whether "Disable Cortana" is currently applied.
Usage:
python check_disable_cortana_status.py
"""
import winreg
def main() -> None:
try:
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Policies\Microsoft\Windows\Windows Search")
value, _ = winreg.QueryValueEx(key, "AllowCortana")
winreg.CloseKey(key)
print(f"Current value of 'AllowCortana': {value}")
except FileNotFoundError:
print("'AllowCortana' is not set (using the Windows default).")
if __name__ == "__main__":
main()