@echo off
title Obtener Codigo de Equipo (HWID)
color 0B
chcp 65001 >nul

echo =====================================================================
echo    OBTENIENDO TU CODIGO DE EQUIPO PARA LA LICENCIA DE LA WEB
echo =====================================================================
echo.
echo [*] Escaneando componentes fisicos de tu PC...

powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& { try { $u = (Get-CimInstance Win32_ComputerSystemProduct -ErrorAction SilentlyContinue).UUID } catch { $u = 'NO_UUID' }; try { $m = (Get-CimInstance Win32_BaseBoard -ErrorAction SilentlyContinue).SerialNumber } catch { $m = 'NO_MB' }; try { $c = (Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue | Select-Object -First 1).ProcessorId } catch { $c = 'NO_CPU' }; try { $g = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Cryptography' -Name 'MachineGuid' -ErrorAction SilentlyContinue).MachineGuid } catch { $g = 'NO_GUID' }; $raw = ('HWID_V1|' + $u + '|' + $m + '|' + $c + '|' + $g).Trim(); $sha = [System.Security.Cryptography.SHA256]::Create(); $hashBytes = $sha.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($raw)); $fullHex = [System.BitConverter]::ToString($hashBytes).Replace('-', '').ToUpper(); $shortCode = 'HWID-' + $fullHex.Substring(0, 4) + '-' + $fullHex.Substring(4, 4) + '-' + $fullHex.Substring(8, 4); Set-Clipboard -Value $shortCode; Clear-Host; Write-Host '=====================================================================' -ForegroundColor Cyan; Write-Host '               TU CODIGO DE EQUIPO HA SIDO DETECTADO                 ' -ForegroundColor Yellow; Write-Host '=====================================================================' -ForegroundColor Cyan; Write-Host ''; Write-Host ' Codigo HWID: ' -NoNewline -ForegroundColor White; Write-Host $shortCode -ForegroundColor Green; Write-Host ''; Write-Host ' [OK] ¡EL CODIGO YA HA SIDO COPIADO A TU PORTAPAPELES!' -ForegroundColor Yellow; Write-Host ' Solo regresa a la pagina web y presiona Ctrl + V en la casilla.' -ForegroundColor White; Write-Host '=====================================================================' -ForegroundColor Cyan; Write-Host '' }"

echo Presiona cualquier tecla para cerrar esta ventana...
pause >nul
exit /b 0
