Get-keys.bat Site
The Ultimate Guide to Get-Keys.bat: Unlocking the Power of Windows Product Keys
Are you tired of dealing with Windows activation issues? Do you struggle to find the product key for your Windows installation? Look no further! In this comprehensive article, we'll explore the world of get-keys.bat, a powerful script that can help you recover your Windows product key and resolve activation issues.
What is Get-Keys.bat?
get-keys.bat is a simple yet powerful batch script that retrieves the product key from a Windows installation. The script uses a combination of Windows API calls and registry queries to extract the product key, which is then displayed on the screen or saved to a file. The script is designed to work on Windows 7, 8, 8.1, and 10 installations, making it a versatile tool for users and administrators alike.
How Does Get-Keys.bat Work?
The get-keys.bat script uses a combination of Windows API calls and registry queries to extract the product key. Here's a step-by-step breakdown of the process:
- Registry Query: The script queries the Windows registry to retrieve the product key. The product key is stored in the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform. - API Call: The script uses the Windows API to retrieve the product key. Specifically, it uses the
WMI(Windows Management Instrumentation) API to query theSoftwareLicensingServiceclass. - Decryption: The script decrypts the product key using a proprietary algorithm. This ensures that the product key is displayed in a readable format.
Benefits of Using Get-Keys.bat
Using get-keys.bat offers several benefits, including:
- Easy Product Key Recovery: With
get-keys.bat, you can easily recover your Windows product key, eliminating the need to search for it on your installation media or in your email inbox. - Activation Troubleshooting: The script can help you troubleshoot Windows activation issues by providing the product key and other relevant information.
- Convenience: The script is easy to use and requires no technical expertise. Simply download the script, run it, and retrieve your product key.
Common Use Cases for Get-Keys.bat
Here are some common use cases for get-keys.bat: get-keys.bat
- Reinstalling Windows: When reinstalling Windows, you may need to enter your product key to activate your installation.
get-keys.batmakes it easy to retrieve your product key and complete the activation process. - Upgrading to a New Version: When upgrading to a new version of Windows, you may need to enter your product key to activate your installation.
get-keys.batcan help you retrieve your product key and complete the activation process. - Troubleshooting Activation Issues: If you're experiencing activation issues,
get-keys.batcan help you troubleshoot the problem by providing the product key and other relevant information.
How to Use Get-Keys.bat
Using get-keys.bat is easy. Here's a step-by-step guide:
- Download the Script: Download the
get-keys.batscript from a reputable source. Make sure to scan the script for viruses or malware before running it. - Run the Script: Run the script by double-clicking on the
get-keys.batfile. - Retrieve Your Product Key: The script will display your product key on the screen. You can also save the product key to a file by modifying the script.
Tips and Tricks
Here are some tips and tricks for using get-keys.bat:
- Run as Administrator: To ensure that the script works correctly, run it as an administrator.
- Save to a File: Consider saving the product key to a file, especially if you're using a new computer or reinstalling Windows.
- Use with Other Tools: You can use
get-keys.batwith other tools, such asslmgr.vbs, to manage your Windows installation and troubleshoot activation issues.
Conclusion
In conclusion, get-keys.bat is a powerful script that can help you retrieve your Windows product key and resolve activation issues. With its ease of use and versatility, get-keys.bat is a valuable tool for users and administrators alike. Whether you're reinstalling Windows, upgrading to a new version, or troubleshooting activation issues, get-keys.bat is a must-have tool in your toolkit.
Frequently Asked Questions
Here are some frequently asked questions about get-keys.bat:
- Q: Is get-keys.bat safe to use?
A: Yes,
get-keys.batis safe to use. However, make sure to download the script from a reputable source and scan it for viruses or malware before running it. - Q: Can I use get-keys.bat on any version of Windows?
A: Yes,
get-keys.batworks on Windows 7, 8, 8.1, and 10 installations. - Q: Can I use get-keys.bat to retrieve my product key if I've lost it?
A: Yes,
get-keys.batcan help you retrieve your product key even if you've lost it. However, make sure to have access to your Windows installation and administrative privileges.
By following this guide, you'll be able to unlock the power of get-keys.bat and manage your Windows product key with ease. The Ultimate Guide to Get-Keys
Supported targets (examples)
- Windows Registry locations used by common software (e.g., Microsoft Office, some installers).
- Local files: configuration files, .ini, .xml, .conf, license files under Program Files, AppData, and common install paths.
- Windows activation product key from WMI/registry (best-effort — may be masked or unavailable).
- Custom user-specified paths.
Step 1: Open Notepad
Press Windows Key + R, type notepad, and press Enter.
Step 2: Copy and Paste the Following Code
This is a community-vetted, safe script that attempts three methods and displays the result clearly.
@echo off title Product Key Retrieval Tool color 0A echo ============================================== echo get-keys.bat - Product Key Finder echo ============================================== echo.:: Method 1: Check for BIOS OEM Key (Modern PCs) echo [1] Checking UEFI/BIOS for embedded key... for /f "tokens=*" %%a in ('wmic path SoftwareLicensingService get OA3xOriginalProductKey /value') do call set %%a >nul 2>&1 if defined OA3xOriginalProductKey ( echo [+] BIOS Embedded Key Found: %OA3xOriginalProductKey% echo. ) else ( echo [-] No BIOS embedded key found. echo. )
:: Method 2: Try PowerShell Method echo [2] Attempting PowerShell extraction... powershell -command "Get-WmiObject -Class SoftwareLicensingService | Select-Object -Property OA3xOriginalProductKey" > "%temp%\pskey.txt" 2>nul findstr /C:"-" "%temp%\pskey.txt" >nul if %errorlevel% equ 0 ( echo [+] PowerShell Extraction Successful: type "%temp%\pskey.txt" | findstr /V "OA3xOriginalProductKey" ) else ( echo [-] PowerShell method failed. ) del "%temp%\pskey.txt" 2>nul echo.
:: Method 3: Registry Fallback (Requires Decoder) echo [3] Checking Registry (Decoding may take a moment)... echo [+] Creating temporary decoder... echo Set WshShell = CreateObject("WScript.Shell") > "%temp%\keydecode.vbs" echo MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")) >> "%temp%\keydecode.vbs" echo Function ConvertToKey(Key) >> "%temp%\keydecode.vbs" echo Const KeyOffset = 52 >> "%temp%\keydecode.vbs" echo i = 28 >> "%temp%\keydecode.vbs" echo Chars = "BCDFGHJKMPQRTVWXY2346789" >> "%temp%\keydecode.vbs" echo Do >> "%temp%\keydecode.vbs" echo Cur = 0 >> "%temp%\keydecode.vbs" echo x = 14 >> "%temp%\keydecode.vbs" echo Do >> "%temp%\keydecode.vbs" echo Cur = Cur * 256 >> "%temp%\keydecode.vbs" echo Cur = Key(x + KeyOffset) + Cur >> "%temp%\keydecode.vbs" echo Key(x + KeyOffset) = (Cur \ 24) And 255 >> "%temp%\keydecode.vbs" echo Cur = Cur Mod 24 >> "%temp%\keydecode.vbs" echo x = x -1 >> "%temp%\keydecode.vbs" echo Loop While x ^>= 0 >> "%temp%\keydecode.vbs" echo i = i -1 >> "%temp%\keydecode.vbs" echo KeyOutput = Mid(Chars, Cur + 1, 1) ^& KeyOutput >> "%temp%\keydecode.vbs" echo If (((29 - i) Mod 6) = 0) And (i ^<> -1) Then >> "%temp%\keydecode.vbs" echo i = i -1 >> "%temp%\keydecode.vbs" echo KeyOutput = "-" ^& KeyOutput >> "%temp%\keydecode.vbs" echo End If >> "%temp%\keydecode.vbs" echo Loop While i ^>= 0 >> "%temp%\keydecode.vbs" echo ConvertToKey = KeyOutput >> "%temp%\keydecode.vbs" echo End Function >> "%temp%\keydecode.vbs" cscript //nologo "%temp%\keydecode.vbs" del "%temp%\keydecode.vbs" 2>nul echo. echo ============================================== echo Script completed. Press any key to exit. pause >nul
Example get-keys.bat Script
Here’s a safe, non-malicious version you can save as get-keys.bat:
@echo off title Windows & Office Key Retriever echo ======================================== echo Windows & Office Key Extractor echo ======================================== echo.:: Retrieve Windows product key from registry (if stored) echo [*] Checking Windows Product Key... wmic path softwarelicensingproduct get OA3xOriginalProductKey 2>nul if errorlevel 1 ( echo [!] Could not retrieve OEM key. Trying alternative method... powershell -command "(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey" )
echo.
:: Retrieve product key using Visual Basic script fallback echo [*] Attempting fallback method via VBS... echo Set WshShell = CreateObject("WScript.Shell") > "%temp%\key.vbs" echo MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")) >> "%temp%\key.vbs" echo Function ConvertToKey(Key) >> "%temp%\key.vbs" echo Const KeyOffset = 52 >> "%temp%\key.vbs" echo i = 28 >> "%temp%\key.vbs" echo Chars = "BCDFGHJKMPQRTVWXY2346789" >> "%temp%\key.vbs" echo Do >> "%temp%\key.vbs" echo Cur = 0 >> "%temp%\key.vbs" echo x = 14 >> "%temp%\key.vbs" echo Do >> "%temp%\key.vbs" echo Cur = Cur * 256 >> "%temp%\key.vbs" echo Cur = Key(x + KeyOffset) + Cur >> "%temp%\key.vbs" echo Key(x + KeyOffset) = (Cur \ 24) And 255 >> "%temp%\key.vbs" echo Cur = Cur Mod 24 >> "%temp%\key.vbs" echo x = x -1 >> "%temp%\key.vbs" echo Loop While x >= 0 >> "%temp%\key.vbs" echo i = i -1 >> "%temp%\key.vbs" echo KeyOutput = Mid(Chars, Cur + 1, 1) ^& KeyOutput >> "%temp%\key.vbs" echo If (((29 - i) Mod 6) = 0) And (i ^<^> -1) Then >> "%temp%\key.vbs" echo KeyOutput = "-" ^& KeyOutput >> "%temp%\key.vbs" echo End If >> "%temp%\key.vbs" echo Loop While i >= 0 >> "%temp%\key.vbs" echo ConvertToKey = KeyOutput >> "%temp%\key.vbs" echo End Function >> "%temp%\key.vbs" cscript //nologo "%temp%\key.vbs" del "%temp%\key.vbs"
echo.
:: Retrieve Office product key (if installed) echo [] Checking for Microsoft Office keys... for /f "tokens=2" %%A in ('reg query HKLM\SOFTWARE\Microsoft\Office\16.0\Registration /v ProductName 2^>nul') do set OFFICEVER=%%B if defined OFFICEVER ( echo Found Office: %OFFICEVER% echo Trying to extract key from registry... reg query HKLM\SOFTWARE\Microsoft\Office\16.0\Registration /v DigitalProductId >nul 2>&1 if %errorlevel%==0 ( echo [*] Office key may be encoded. Use specialized tool for exact retrieval. ) ) else ( echo No Office 2016/2019/2021 installation detected. )
echo. echo ======================================== echo Script completed. pause
What the Script Does
| Command | Purpose |
|---------|---------|
| wmic path softwarelicensingproduct | Tries to read the OEM Windows key from BIOS |
| powershell ... OA3xOriginalProductKey | Alternative method for newer Windows versions |
| cscript + VBS | Decodes the registry’s encrypted product key |
| reg query ... Office | Finds Office registration entries |
A. Dumping Local Password Hashes (SAM/SYSTEM)
The script often attempts to backup the registry hives where local password hashes are stored.
reg save HKLM\SAM sam.bak
reg save HKLM\SYSTEM system.bak
- Impact: An attacker can take these
.bakfiles offline and use tools likeImpacketorCrackStationto crack the local administrator password.
4. Compatibility & Limitations
This is the critical area where get-keys.bat shows its age or limitations.
- Legacy vs. Modern Windows: The script works perfectly for Windows 7, 8.1, and early builds of Windows 10. However, it struggles with modern digital entitlements. If your Windows 10/11 license was activated via a Digital License (linked to the motherboard hardware ID) rather than a traditional key entry, this script may return a generic key (e.g.,
VK7JG-NPHTM-C97JM-9MPGT-3V66T) or no key at all. It cannot extract a key that doesn't technically exist in the registry storage. - Architecture: Most modern versions handle both x86 and x64 architectures correctly, but older scripts may fail on 64-bit systems due to registry redirection issues unless specifically coded to handle them.