import _winreg as winreg

# Define the registry path
reg_path = r"SOFTWARE\Policies\Microsoft\Edge\URLBlocklist"

# Open the registry key or create it if it doesn't exist
try:
    key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, reg_path)

    # Set the values
    winreg.SetValueEx(key, "1", 0, winreg.REG_SZ, "gmail.com")
    winreg.SetValueEx(key, "2", 0, winreg.REG_SZ, "accounts.google.com")
    winreg.SetValueEx(key, "3", 0, winreg.REG_SZ, "drive.google.com")
    winreg.SetValueEx(key, "4", 0, winreg.REG_SZ, "mail.google.com")

    # Close the key
    winreg.CloseKey(key)
    print("Registry keys created successfully.")

except Exception as e:
    print("Failed to create registry keys:", e)
