def rule(event):
    if all(
        [
            event.deep_get("TargetObject", default="").endswith("\\Environment\\windir"),
            not event.deep_get("Details", default="") == "%SystemRoot%",
        ]
    ):
        return True
    return False
