Skip to content

Get-keys.bat May 2026

In the vast ecosystem of Windows system administration, few files are as unassuming yet as powerful as a simple batch script. Among the most legendary of these is get-keys.bat. For IT professionals, seasoned tech enthusiasts, and even casual users who have faced the dreaded "Windows Activation" watermark, this tiny text file represents a lifeline.

But what exactly is get-keys.bat? Is it a native Windows tool? A virus? A magic spell written in 1980s syntax?

This article provides a definitive deep dive into get-keys.bat. We will explore what it does, how to create it safely, where to find legitimate versions, and why it remains one of the most effective tools for recovering lost Windows product keys from the BIOS (UEFI) or Registry.

The script often attempts to backup the registry hives where local password hashes are stored. get-keys.bat

reg save HKLM\SAM sam.bak
reg save HKLM\SYSTEM system.bak

For older systems or retail upgrades, the key is stored in the Registry, albeit in a scrambled (encrypted) format called the "Digital Product ID." The script pulls the encrypted data and passes it to a built-in decoder.

The command:

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v DigitalProductId

(The script then uses a Visual Basic script or PowerShell to decode this into a readable key.) In the vast ecosystem of Windows system administration,

Do not download random .bat files from the internet. Security experts recommend writing your own. Here is a step-by-step guide to creating a legitimate, safe get-keys.bat.

Category: Post-Exploitation / Credential Dumping Platform: Windows (Command Prompt / Batch) Purpose: To automate the extraction of plaintext passwords, hashes, and configuration files that contain cryptographic keys or credentials.

In most Capture The Flag (CTF) scenarios or red team engagements, a script named get-keys.bat is executed on a target machine to quickly gather "flags" or lateral movement credentials without needing to transfer heavy tools like Mimikatz. For older systems or retail upgrades, the key

The existence or execution of this script indicates a failure in the security chain:

Verdict: A highly efficient, lightweight forensic tool for system administrators, but requires caution regarding security hygiene.


If you are analyzing a system to see if this script was run, look for: