Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # Filename: disable_securityhealth_startup.py
- # Version: 1.00
- # Author: Jeoi Reqi
- """
- DISABLE SECURITY HEALTH FROM STARTUP APPS:
- - This script removes 'SecurityHealth' from the startup menu on Windows OS.
- - It accomplishes this by setting the registry value to '0' (Disabled).
- - You can edit the value back to '1' (Enabled) at any time.
- Requirements:
- - Python 3
- - Compatible Windows OS Versions: (Vista-11)
- Note:
- - This script requires elevated administrator permissions to edit the registry.
- - It is recommended to create a backup of the registry before making any changes.
- """
- import winreg
- # Function to disable a startup entry in the Windows registry.
- def disable_startup_entry(entry_name):
- """
- This function removes the specified startup entry from the Windows registry, effectively disabling it
- from running automatically when the system starts up.
- Args:
- entry_name (str): The name of the startup entry to be disabled.
- """
- key_path = r"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run"
- with winreg.OpenKey(winreg.HKEY_CURRENT_USER, key_path, 0, winreg.KEY_ALL_ACCESS) as key:
- try:
- winreg.DeleteValue(key, entry_name)
- print(f"\nDisabled startup entry: {entry_name}\n")
- except FileNotFoundError:
- print(f"\nStartup entry not found: {entry_name}\n")
- if __name__ == "__main__":
- startup_entry = "SecurityHealthSystray"
- disable_startup_entry(startup_entry)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement