def rule(event):
    if all(
        [
            "\\Software\\Policies\\Microsoft\\Windows\\System\\Scripts"
            in event.deep_get("TargetObject", default=""),
            any(
                [
                    "\\Startup" in event.deep_get("TargetObject", default=""),
                    "\\Shutdown" in event.deep_get("TargetObject", default=""),
                    "\\Logon" in event.deep_get("TargetObject", default=""),
                    "\\Logoff" in event.deep_get("TargetObject", default=""),
                ]
            ),
            not event.deep_get("Details", default="") == "(Empty)",
        ]
    ):
        return True
    return False
