Created
June 29, 2026 08:35
-
-
Save EncodeTheCode/a282c6410ed134bc0b6b5566a8f783a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import platform | |
| import ctypes | |
| import sys | |
| import subprocess | |
| try: | |
| import winreg | |
| except ImportError: | |
| winreg = None | |
| # ---------------------------- | |
| # SYSTEM INFO | |
| # ---------------------------- | |
| def get_registry(path, name): | |
| if winreg is None: | |
| return "Registry unavailable" | |
| try: | |
| key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path) | |
| value, _ = winreg.QueryValueEx(key, name) | |
| return str(value) | |
| except Exception: | |
| return "Not found" | |
| def get_windows_info(): | |
| return { | |
| "edition": get_registry( | |
| r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", | |
| "ProductName" | |
| ), | |
| "release_id": get_registry( | |
| r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", | |
| "ReleaseId" | |
| ), | |
| "display_version": get_registry( | |
| r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", | |
| "DisplayVersion" | |
| ), | |
| "build": get_registry( | |
| r"SOFTWARE\Microsoft\Windows NT\CurrentVersion", | |
| "CurrentBuildNumber" | |
| ), | |
| } | |
| def run_slmgr(): | |
| try: | |
| cmd = ["cscript", "//nologo", r"C:\Windows\System32\slmgr.vbs", "/xpr"] | |
| return subprocess.check_output(cmd, text=True, stderr=subprocess.STDOUT) | |
| except Exception as e: | |
| return f"slmgr check failed: {e}" | |
| # ---------------------------- | |
| # LOGIC | |
| # ---------------------------- | |
| def analyze_system(info): | |
| edition = info["edition"] | |
| display_version = info["display_version"] | |
| build = info["build"] | |
| notes = [] | |
| # Check edition | |
| if "Pro" in edition: | |
| notes.append("✔ Windows 10 Pro detected") | |
| else: | |
| notes.append("⚠ Non-Pro edition detected (behavior may differ)") | |
| # Check version | |
| if display_version == "22H2": | |
| notes.append("✔ Version 22H2 confirmed (final Windows 10 release)") | |
| notes.append("✔ You are in normal support phase (NOT ESU)") | |
| else: | |
| notes.append(f"ℹ Version: {display_version}") | |
| # Build interpretation | |
| try: | |
| build_num = int(build) | |
| if build_num >= 19045: | |
| notes.append("✔ Modern Windows 10 build (22H2 baseline)") | |
| except: | |
| notes.append("⚠ Build number could not be interpreted") | |
| # ESU explanation (important truth) | |
| notes.append("") | |
| notes.append("🔐 ESU Status Interpretation:") | |
| notes.append("❌ ESU cannot be detected locally on Windows 10 Pro") | |
| notes.append("❌ Receiving updates does NOT mean ESU is active") | |
| notes.append("✔ Your updates are standard Microsoft cumulative updates") | |
| # Likely state | |
| notes.append("") | |
| notes.append("📊 Likely System State:") | |
| notes.append("➡ Normal Windows 10 servicing (not ESU)") | |
| notes.append("➡ Receiving standard security updates from Microsoft") | |
| return "\n".join(notes) | |
| # ---------------------------- | |
| # OUTPUT | |
| # ---------------------------- | |
| def show_message(title, message): | |
| ctypes.windll.user32.MessageBoxW(0, message, title, 0x40) | |
| def main(): | |
| info = get_windows_info() | |
| analysis = analyze_system(info) | |
| slmgr = run_slmgr() | |
| final_message = ( | |
| "🖥️ Windows 10 Support Checker (Pro-aware)\n\n" | |
| f"Edition: {info['edition']}\n" | |
| f"Version: {info['display_version']}\n" | |
| f"Build: {info['build']}\n\n" | |
| + analysis + | |
| "\n\n🧾 Activation check (/xpr):\n" | |
| + slmgr | |
| ) | |
| print(final_message) | |
| show_message("Windows 10 Status Report", final_message) | |
| if __name__ == "__main__": | |
| if not sys.platform.startswith("win"): | |
| print("Windows only.") | |
| sys.exit(1) | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment