@echo off
title Angel Hub Finder - Machine ID
color 0B

echo.
echo   ================================================
echo    Angel Hub Finder - Get Your Machine ID
echo   ================================================
echo.
echo   Reading device ID...
echo.

for /f "usebackq delims=" %%i in (`powershell -NoProfile -Command "(Get-CimInstance Win32_ComputerSystemProduct).UUID"`) do (
    if not "%%i"=="" (
        set "UUID=%%i"
        goto :gotuuid
    )
)
:gotuuid

if not defined UUID (
    echo   [ERROR] Could not read machine ID. Please contact support.
    echo.
    pause
    exit /b 1
)

set "PART1=%UUID:~0,4%"
set "PART2=%UUID:~-4%"
set "MACHINEID=DEV-%PART1%-%PART2%"

echo   Your Machine ID is:
echo.
echo   ------------------------------
echo      %MACHINEID%
echo   ------------------------------
echo.

echo %MACHINEID%| clip

echo   Copied to clipboard - paste it (Ctrl+V) into the website.
echo.
echo   This window will close automatically in 8 seconds...
timeout /t 8 /nobreak >nul 2>&1
exit /b 0
