#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Force-kill all running Medicus processes instantly.
No graceful wait, no exceptions if already closed.
"""

import psutil

TARGETS = ["Medicus.exe", "MedicusServer.exe", "MedicusUpdater.exe"]

for proc in psutil.process_iter(["name", "pid"]):
    try:
        name = proc.info["name"]
        if name and name.lower() in [t.lower() for t in TARGETS]:
            print(f"💀 Killing {name} (PID {proc.pid})")
            proc.kill()
    except (psutil.NoSuchProcess, psutil.AccessDenied):
        continue

print("✅ All Medicus processes terminated.")
