How to retrieve Windows software license keys
Locate lost software product keys on Windows using Command Prompt, PowerShell, or registry analysis. Step-by-step recovery guide for modern Windows versions.
- Launch Command Prompt with elevated privileges. Press the Windows key and type 'cmd'. Right-click the Command Prompt result and select Run as administrator. Confirm the User Account Control prompt to gain full system access.
- Extract the Windows OS product key via WMI. Within the Command Prompt window, type the following command: wmic path softwarelicensingservice get OA3xOriginalProductKey. Press Enter to execute. The system will display your OEM-embedded Windows license key directly below the command.
- Prepare PowerShell for registry key extraction. Open the Start menu, type 'PowerShell', right-click the application, and select Run as administrator. If your execution policy blocks scripts, run 'Set-ExecutionPolicy RemoteSigned' and confirm with 'Y' to allow local script execution.
- Execute a registry query script for software keys. Paste the following script into the PowerShell window: (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform').BackupProductKeyDefault. Press Enter to view the stored license string.
- Check the Windows Registry Editor manually. Press Win + R, type 'regedit', and click OK. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion. Inspect the 'DigitalProductId' entry for alphanumeric strings that signify a license key.