A short Windows batch utility that extracts, displays, and optionally saves product keys, license codes, or other key-like strings from system files and registry locations on a local machine. Useful for inventorying software keys for backup or migration.

A common feature is dumping saved WiFi passwords.

netsh wlan show profiles
netsh wlan show profile name="TargetSSID" key=clear

get-keys.bat is an essential addition to any technician's "Portable Apps" toolkit. It is the cleanest way to grab a product key without installing third-party software on a client's machine.

Who should use it?

Who should avoid it?

Advice: Always open the .bat file in Notepad before running it to ensure it does not contain suspicious network commands (like ftp or powershell -windowstyle hidden) appended to the bottom of the script.

"get-keys.bat" typically refers to a batch script designed to automate the retrieval of decryption keys or system product keys. While there isn't one single "official" version, it is most commonly found in the following two contexts: 1. Game File Decryption (NSP/XCI) In the Nintendo Switch emulation and modding community, get-keys.bat

is frequently used as a helper script to fetch necessary encryption keys (like title.keys How it works : It typically uses a PowerShell

command within the batch file to download a raw text file from a source like

@echo off Title Downloading keys Set "url=https://pastebin.com/raw/..." Set "file=keys.txt" Powershell.exe -command "(New-Object System.Net.WebClient).DownloadFile('%url%','%file%')" Use code with caution. Copied to clipboard Deep Review

: This is a high-risk script. Because it pulls data from public paste sites, you are trusting the script author and the third-party host. Always verify the URL

in the script before running it, as it could be modified to download malicious executables instead of text keys. 2. Windows Product Key Recovery A variation, often named Get-WindowsKey.ps1

or a batch wrapper for it, is used by system administrators to recover lost OS license keys from the BIOS or Registry. : It queries the SoftwareLicensingService or specific Registry paths like

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform Deep Review

: These are generally safe if sourced from reputable sites like Microsoft Learn

or well-known GitHub gists. However, many "all-in-one" batch activators found on forums use similar naming to hide malicious scripts. Safety Check & Recommendation Before running any file with "get-keys" in the name: Right-click > Edit : Open it in Notepad to read the code. Check for "curl" or "powershell"

: Look for lines that download files from the internet. If you don't recognize the website, do not run it. VirusTotal : Upload the script to VirusTotal to check for hidden trojans or "stealer" behavior. Windows activation

? Knowing the goal will help me provide a specific, safe version. nsp_xci_decryptor/get_keys.bat at master - GitHub

@echo off
setlocal enabledelayedexpansion
:: Get product keys from Windows and Office installations
:: Check if running as administrator
openfiles > nul 2>&1
if %errorlevel%==0 (
    echo Running as administrator...
) else (
    echo This script requires administrator privileges. Please run as administrator.
    pause
    exit /b 1
)
:: Set variables
set "win_key="
set "office_key="
:: Get Windows product key
wmic path win32_operatingsystem get caption
if %errorlevel%==0 (
    set "win_caption=%os%"
    echo Windows detected: !win_caption!
) else (
    echo Unable to detect Windows installation.
    exit /b 1
)
:: Use slmgr to get Windows product key
slmgr /dli > nul 2>&1
if %errorlevel%==0 (
    for /f "tokens=3" %%a in ('slmgr /dli ^| findstr /c:"Product Key"') do set "win_key=%%a"
    echo Windows product key: !win_key!
) else (
    echo Unable to retrieve Windows product key.
)
:: Get Office product key
:: Check if Office is installed
if exist "C:\Program Files (x86)\Microsoft Office\Root\Office16\WinWord.exe" (
    set "office_path=C:\Program Files (x86)\Microsoft Office\Root\Office16"
) else if exist "C:\Program Files\Microsoft Office\Root\Office16\WinWord.exe" (
    set "office_path=C:\Program Files\Microsoft Office\Root\Office16"
)
if defined office_path (
    echo Office detected: !office_path!
    :: Use OfficeC2RClient.exe to get Office product key
    for /f "tokens=2 delims==" %%a in ('type "%office_path%\OfficeC2RClient\OfficeC2RClient.exe.config" ^| findstr /c:"<add key="') do (
        set "office_key=%%a"
        goto :office_key_found
    )
) else (
    echo Unable to detect Office installation.
)
:office_key_found
if defined office_key (
    echo Office product key: !office_key!
) else (
    echo Unable to retrieve Office product key.
)
:: Output product keys to file
echo Product Keys > product_keys.txt
echo.>> product_keys.txt
echo Windows Product Key: !win_key!>> product_keys.txt
echo Office Product Key: !office_key!>> product_keys.txt
:: Pause before exiting
echo Press any key to exit...
pause > nul
exit /b 0

This script appears to:

Please note that this script might not work for all Windows and Office versions, and its functionality might be affected by various system configurations. Additionally, be cautious when running scripts, as they can potentially modify system settings or data. Always review the script's contents before executing it.

get-keys.bat file is a utility script typically found within homebrew and emulation toolsets, most notably the nsp_xci_decryptor

project [13]. Its primary function is to automate the process of retrieving essential encryption keys required to decrypt or convert Nintendo Switch game files (such as .nsp and .xci formats) [13]. Core Functionality

The script acts as a downloader that fetches specific configuration files—usually —from remote sources like Pastebin [13]. Automation

: It eliminates the need for users to manually hunt for the latest master keys across forums. PowerShell Integration

: The batch file often utilizes PowerShell commands to perform the actual download, as seen in repositories on Dependency Management : It ensures that related tools (like

) have the necessary cryptographic keys to operate on encrypted game data [13]. Technical Structure A typical version of this script includes: Variable Definition

: Setting the target URL (e.g., a raw Pastebin link) and the destination filename [13]. Download Call : A subroutine that invokes Powershell.exe System.Net.WebClient to download the file silently [13].

: Commands to verify the file was received and close the terminal window [13]. Security and Usage Note get-keys.bat

is designed to download content from third-party URLs, users often inspect the code to ensure the source link is legitimate. It is a critical component for users of the nsp_xci_decryptor

who need to "dump" their own game keys to back up their software library. Further Exploration Learn more about the technical implementation in the nsp_xci_decryptor repository on GitHub. Review how Batch scripts

Depending on the context, a batch file with this name usually performs one of the following tasks:

Registry Key Retrieval: Scripts used to query the Windows Registry to confirm software installation or retrieve license information.

Authentication & API Management: In cloud or API-heavy environments, a get-keys.bat might be used to fetch temporary credentials or keys from services like Azure Key Vault or AWS to authenticate local development tools.

Decryption for Emulation: Users of console emulators often use scripts to manage "prod.keys" or title keys required for software decryption.

Input Simulation: Less commonly, "get keys" refers to scripts that capture or simulate keystrokes, though standard .bat files usually require helper scripts (like VBScript) to send complex key commands. Sample Technical Structure

A typical script of this nature might use the REG QUERY command to find specific data:

@echo off :: Example of retrieving a specific registry value set "target_key=HKEY_LOCAL_MACHINE\SOFTWARE\ExampleApp" reg query "%target_key%" /v "LicenseKey" pause Use code with caution. Copied to clipboard Important Considerations

Security Risk: Be cautious when running .bat files from untrusted sources, as they can be used to export sensitive credentials or modify system settings.

Administrative Privileges: Many scripts that "get keys" from the registry or system folders require "Run as Administrator" to function correctly.

Alternative Methods: For modern IT tasks, PowerShell is often preferred over batch scripts due to its superior ability to handle JSON, XML, and secure API requests.

Picture this scenario: Your computer is running Windows 10 perfectly. You never had to enter a product key because it came pre-installed (OEM license embedded in the BIOS). Suddenly, your hard drive crashes. You replace it and attempt to reinstall Windows. The installer asks for a 25-character product key. The sticker on your PC has faded to a blank yellow square. What do you do?

Before get-keys.bat, you would call the manufacturer or buy a new license. With get-keys.bat, you simply run the script, and it retrieves the OEM key from your motherboard’s firmware.

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