How to Uninstall a Windows Product Key: The Direct Answer
To remove a Windows product key, open an admin Command Prompt and run slmgr /upk to deactivate, then slmgr /cpky to clear the key from the registry. Do this before selling a PC (to protect or reuse a retail key) or before transferring a retail license to a new machine.
When You Should Remove Your Key
Two main scenarios: you are selling or giving away the PC and want to protect your retail key from misuse, or you are transferring a retail license to a new computer. In both cases, deactivating on the old machine first is the correct step.
Step-by-Step: Removing the Key
- Open Command Prompt as administrator (right-click > Run as administrator)
- Run
slmgr /upkand press Enter — this uninstalls the product key - Run
slmgr /cpkyand press Enter — this clears the key from the registry - Restart the PC — Windows is now deactivated
Retail vs OEM: What You Can Transfer
Only retail licenses can move to a new PC. If your key is retail, deactivate it on the old machine and activate it on the new one. OEM keys are permanently tied to the original motherboard and cannot be transferred — check your license type with slmgr /dli first.
Before Selling Your PC
Deactivating Windows is only part of preparing a PC for sale. You should also back up your files, then reset the PC (Settings > System > Recovery > Reset PC) to wipe your personal data. This protects both your license and your privacy.
The Bottom Line
Remove your product key with slmgr /upk and slmgr /cpky before selling or transferring. Retail keys can then be reused on a new PC. If you need a fresh genuine key, see the product below.
