Retrieve Oem bios Windows License key (uefi)

Did a clean install on a device & Windows did not pick up the bios activation key? no 3rd party tools required, these commands will retrieve the key for you

Run this in PowerShell (Elevated) to retrieve the key

(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey

Retrieve & install: (run in elevated prompt)

@echo off
FOR /F "skip=1" %%A IN ('wmic path SoftwareLicensingService get OA3xOriginalProductKey') DO  (
SET "ProductKey=%%A"
goto InstallKey
)

:InstallKey
IF [%ProductKey%]==[] (
echo No key present
) ELSE (
echo Installing %ProductKey%
changepk.exe /ProductKey %ProductKey%
)

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.