Cart0

Windows · guide · 4 min read

How to Remove a Windows Product Key

Updated

How to Remove a Windows Product Key

Short answer: To remove a Windows product key, open Command Prompt as administrator. Run the upk line of slmgr, then the cpky line, and restart. The key is uninstalled and cleared from the registry. A firmware key and a digital license stay with the hardware, so we'd save a retail key first.

To remove a Windows product key you run two short lines in an administrator Command Prompt. The first uninstalls the key from Windows. The second wipes it from the registry. Restart, and Windows shows as not activated. Apps and files stay put.

Why remove it Does this do it
Moving a retail key to another PC Yes; this is the first step of the move
Selling or giving away a PC with your retail key on it Yes
Replacing a wrong or volume key Yes, though installing the new key replaces the old one anyway
Removing the key that came with a branded PC No; that one sits in the firmware
Cancelling a digital license No; it stays on record for the hardware

Write the key down before you start. Windows can’t show it to you once it’s gone.

Remove a Windows product key: what gets removed

Microsoft’s reference for the licensing script describes both switches.

Switch Microsoft’s description, in short
/upk Uninstalls the product key of the current Windows edition; after a restart the system is unlicensed unless a new key is installed
/cpky Removes the product key from the registry, so malicious code can’t read it

Both need an elevated Command Prompt. The reference is Slmgr.vbs options on Microsoft Learn.

Nothing else changes. Apps, files and settings stay exactly as they were.

How to remove a Windows product key

The whole job takes two minutes.

  1. Find your key in the order email or on the card, and keep a copy outside this PC.
  2. Press Start, type cmd, right-click Command Prompt and choose Run as administrator.
  3. Run the license line and note the last five characters, to be sure which key is installed.
  4. Run the uninstall line and wait for “Uninstalled product key successfully”.
  5. Run the clear line and wait for “Product key from registry cleared successfully”.
  6. Restart the PC.
  7. Open Settings, System, Activation; it should say Windows isn’t activated.
slmgr /dli
slmgr /upk
slmgr /cpky
Line What it does
slmgr /dli Shows the edition, the channel and the last five characters of the installed key
slmgr /upk Uninstalls the key
slmgr /cpky Clears it from the registry
Six numbered steps to remove a Windows product key: save the key, open an administrator Command Prompt, run slmgr /dli, slmgr /upk and slmgr /cpky, then restart and check Activation.
Illustration: save the key, run slmgr /dli, /upk and /cpky in an administrator prompt, then restart.

A line that answers “Access denied” was run in a normal window. That’s 0x80070005, and the cure is the right-click in step 2.

Remove a Windows product key with PowerShell

New option on Windows 11. The OSLicense module does the same two jobs, without the old script.

It came with the September 2026 security update, KB5124008. PowerShell as administrator, then this:

Invoke-OSLicense -UninstallProductKey
Invoke-OSLicense -ClearProductKeyFromRegistry
Switch What it does, per Microsoft Learn
-UninstallProductKey Uninstalls the key; without an Activation ID it picks the first primary Windows product with a partial key
-ClearProductKeyFromRegistry Removes the key from the registry only; it doesn’t uninstall it
-ActivationID Targets one product when several are installed

No message box here. You get back an object. Success, ErrorCode, ErrorMessage: we’d read those three lines rather than guess. Missing module? Then the PC hasn’t got that update yet, and slmgr still works. Reference: Invoke-OSLicense.

Removing one key out of several

Rare at home, normal on some work machines. More than one licensed product shows up, and the plain uninstall line only takes the current Windows edition.

First list them all, with their Activation IDs:

slmgr /dlv all

Copy the Activation ID of the product you want gone. Then:

slmgr /upk ACTIVATION-ID

Same idea in PowerShell, with the ActivationID switch from the table above. We’d check the product name twice before pressing Enter.

Remove a Windows product key from the motherboard or BIOS

Asked a lot. Can’t be done, and there’s no need to.

  • Where it sits. In a firmware table the PC maker wrote at the factory. The firmware setup screens have no delete button for it.
  • What it does. Setup reads it and picks the edition. Nothing more.
  • How to override it. Enter your own key during setup, or later under Change product key. The installed key wins.
  • Want another edition than the one it picks? Enter the key for that edition. Mixing the two up ends in 0xC004F210, the edition mismatch.

Want to see whether a board carries one? How to read it is in our guide to finding your Windows product key.

What the PC looks like afterwards

Area After the key is removed
Activation page Windows is not activated
Desktop The “Activate Windows” text appears after a while
Personalisation Greyed out
Apps, files, updates Unchanged

What that state limits is in our watermark guide. To activate again, enter a key under Change product key.

What it can’t remove

Two things survive the two lines, and both surprise people.

The firmware key. A branded PC that shipped with Windows carries its key on the motherboard. No command deletes it. Reinstall, and setup reads it again by itself.

The digital license. Once a PC was activated, Microsoft has that hardware on record. Uninstalling the key doesn’t change the record. A fresh install of the same edition reactivates on that PC.

Your license After /upk and /cpky After a reinstall on the same PC
Retail key you typed in Not activated; the key is free to use elsewhere May reactivate through the hardware record; that’s fine as long as only one PC uses the key
Preinstalled, key in the firmware Not activated until the next reinstall or key entry Activates again by itself
Digital license from an upgrade Not activated Activates again by itself
Table of what removing a Windows product key with slmgr /upk and /cpky does to a retail key, a firmware key and a digital license, and what happens after a reinstall on the same PC.
Illustration: a removed retail key leaves the PC unactivated, while a firmware key or digital license activates again after a reinstall.

How to tell those license types apart is in digital license vs product key.

Moving the key to another PC

This is the main reason to remove a key. A retail license covers one PC at a time, so the old PC lets go first.

  • Remove the key on the old PC with the two lines.
  • Enter it on the new PC under Settings, System, Activation, Change product key.
  • If the new PC reports that the key is in use, see 0xC004C770.

Only retail keys may move. The whole procedure, and how to check the channel, is in transferring a Windows license to a new PC.

Before selling a PC: remove the Windows product key

The PC has What we’d do
Your own retail key Remove the key, then reset the PC; you keep the license
The key it shipped with Just reset the PC; the license belongs to the machine and goes with it
A company key Hand it to IT before it leaves the building

The reset is under Settings, System, Recovery. For a fully fresh system, our clean install guide has the steps.

Replacing a key without removing it

Want a different key on the same PC? Then you can skip the removal. Installing a new key replaces the old one silently.

slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /ato

That’s how a volume key on a home PC is swapped for a retail one. On such a PC, we’d clear any KMS server name as well. The switch for it is in our slmgr commands reference.

Need the replacement? Ours are genuine and arrive instant to email: Windows 11 Pro and Windows 10 Pro. The Settings route is shown in how to activate Windows 11.

Where the steps to remove a Windows product key apply

System Notes
Windows 11 and Windows 10 All steps as written; on Windows 10 Activation sits under Update & Security
Windows Server The same two lines
Work devices Leave the key alone; it’s the organisation’s

Lost the key before removing it? See how to find your Windows product key first.

Common mistakes when you remove a Windows product key

  • Removing a key that isn’t written down anywhere.
  • Expecting the firmware key to disappear.
  • Removing an OEM key to “move” it to another PC.
  • Forgetting the restart and wondering why Windows still says activated.
  • Running only the first line and leaving the key in the registry.

Terms used on this page

Term Meaning
Product key 25 characters that activate one copy of Windows
Firmware key A key the PC maker stores on the motherboard
Digital license Activation recorded for a device, with no key to enter
Retail A license bought separately that may move to another PC
Elevated Running with administrator rights

FAQ

How do I remove a Windows product key?

Open Command Prompt as administrator. Run the upk switch of slmgr to uninstall the key, then the cpky switch to clear it from the registry. After a restart, Windows shows as not activated.

What does slmgr /upk do?

It uninstalls the product key of the current Windows edition. Per Microsoft, the system is unlicensed after a restart unless a new key is installed. Files and apps aren't affected.

Does removing the key deactivate it on Microsoft's side?

It frees the key on this PC. Microsoft's record of the hardware stays. For a move to another PC that's enough in most cases. If the new PC still says the key is in use, we'd use the offline activation route.

Can I remove the key that came with my laptop?

Not really. That key is stored in the firmware and no command deletes it. The two lines only take it out of the running Windows. A reinstall reads it again.

Should I remove my key before selling a PC?

If it's a retail key you want to keep, yes. If the PC shipped with its key, the license belongs to the machine. Then we'd only reset the PC.

Can I see my key after removing it?

No. Windows only ever showed the last five characters, and after removal it shows nothing. We'd find the key in the order email or on the card before running the lines.

Do I have to remove the old key before entering a new one?

No. Installing a new key replaces the old one silently. Removal is for freeing a key, not for changing it. We'd only remove first when the old key is moving elsewhere.

Is there a PowerShell way, without slmgr?

Yes, on updated Windows 11. Invoke-OSLicense with the UninstallProductKey switch, then the ClearProductKeyFromRegistry one, in PowerShell as administrator.