Skip to content

NinjaEde/ReadWindowsProductKey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🔑 Read Windows 10/11 Product Key

A simple PowerShell script to read the Windows product key stored on the system.

PowerShell Windows License Status


📘 Overview

This repository provides a PowerShell script that reads the locally stored Windows 10/11 product key directly from the Registry.
It is lightweight, safe, and requires no additional software.


🗂 Table of Contents


📝 Description

This script reads the Windows product key from the Registry and outputs it directly to the PowerShell console.
It does not change any system settings and does not write anything to the Registry.

Typical use cases:

  • Documenting the product key
  • Backing it up before a reinstall
  • Verifying OEM/device transfers

⬇️ Download

File in this repository:

read_win11_product_key.ps1


✔️ Requirements

  • Windows 10 or Windows 11
  • PowerShell (minimum version 5, default on Windows)

🛠️ Installation

No installation required.
Just download the file and save it locally.


▶️ Usage

  1. Open PowerShell
  2. Change to the folder where the script is located:
cd C:\Users\<USERNAME>\Downloads

Run the script:

.\read_win11_product_key.ps1

If the system allows script execution, the product key will be displayed.

❗ Common Errors & Solutions

Because Windows PowerShell restricts scripts for security reasons, downloaded scripts are often blocked. Below are common errors and how to resolve them.

❌ Error 1: “Script execution is disabled”

Example message:

The file ... cannot be loaded because running scripts is disabled on this system.

✅ Solution:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Then run again:

.\read_win11_product_key.ps1

❌ Error 2: “The file is not digitally signed”

Example message:

The file ... is not digitally signed. You cannot run this script on the current system.

✅ Solution 1 — less restrictive:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser

✅ Solution 2 — maximum compatibility (no prompts):

Set-ExecutionPolicy Bypass -Scope CurrentUser

❌ You are asked for confirmation every time (“[Y] Yes / [N] No”)

Cause: Windows may block downloaded files by setting the Zone.Identifier.

✅ Solution A — unlock the file once:

Unblock-File .\read_win11_product_key.ps1

✅ Solution B — stop prompts for all scripts:

Set-ExecutionPolicy Bypass -Scope CurrentUser

⚠️ Note:

Using Bypass removes security prompts. Only use it if you trust the scripts.

❓ FAQ

Does the script work with OEM keys? Yes — both OEM and retail keys are read correctly.

Does the script change anything on the system? No — it only reads Registry values.

Can it read cloud-/Microsoft-account keys? No. Those are not stored on the device.

Do I need admin rights? Usually no. If the Registry is restricted, run PowerShell as Administrator.

🔐 Security Notes

The script itself is read-only and safe.

Changing the ExecutionPolicy can reduce system security.

You can restore the default policy at any time:

Set-ExecutionPolicy Restricted -Scope CurrentUser

📄 License

This project is released under the MIT License. Free to use, including commercially.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors