Remove Windows 10 product key from Registry and protect it from being stolen

When Windows 10 is installed, it continues to store your product key in the registry. This may be useful, if you don't remember which key you used on your current installation. Also if you lost your product key, this can be useful for recovering your product key with some third party tool or with a simple PowerShell script.

But at the same time, your Windows 10 product key is at risk of being stolen. If you are concerned about your product key being stolen (i.e. with some malicious software), you might want to remove it from the registry permanently. This operation is safe and will not affect your OS activation status. Follow this simple tutorial to learn how you can erase the stored product key in Windows 10. The same trick should work in Windows 8.1, Windows 7 and Windows Vista too.


  1. Open an elevated command prompt.
  2. In the elevated command prompt you just opened, type the following:
    slmgr /cpky

That's it!

Windows 10 clear product key from Registry

Here is some explanation for those who want to understand what exactly happens. slmgr stands for Software Licensing Manager, it's a Visual Basic script in your Windows\System32 folder to manage licensing related operations. The /cpky switch tells slmgr to clear the product key.

Bonus tip: Even if the product key is cleared, you can still view the partial product key should you ever need to know which key a particular Windows installation uses. To view the partial product key, at an elevated command prompt, type:

slmgr.vbs /dli

Look how it displays the partial product key. If you have a bunch of Windows licenses, this information is enough to identify which product key was used for this installation.

Note that if you installed a volume license edition of Windows, only the partial product key may be viewable by using slmgr /dli. slmgr /cpky is not required.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!


Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

3 thoughts on “Remove Windows 10 product key from Registry and protect it from being stolen”

Leave a Reply

Your email address will not be published.

Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.