Windows 11 has no Deactivate button. The closest thing is uninstalling the product key: open Command Prompt as an administrator, run slmgr /upk, then restart, after which Microsoft says Windows is Unlicensed unless a new key is installed. That matters mainly for a key you plan to reuse; a digital license tied to the hardware isn’t removed this way.
You are selling or retiring a PC and want the Windows 11 license off it before you move that license to a new machine.
What “Deactivating” Windows 11 Actually Means
Activation pairs a product key or digital entitlement with the PC’s hardware. Nothing in Settings reverses that pairing. What you can do is remove the product key Windows is using, with the Software Licensing Management Tool (slmgr.vbs) built into Windows. Microsoft documents its options on the slmgr.vbs options page, and three of them matter here:
| Command | What Microsoft says it does | Admin needed? |
|---|---|---|
| slmgr /upk | Uninstalls the product key of the current Windows edition. After a restart, the system is in an Unlicensed state unless a new key is installed. | Yes |
| slmgr /cpky | Removes the product key from the registry so malicious code can’t steal it. Microsoft calls it best practice for retail installations; it is not the same as /upk. | Yes |
| slmgr /dlv | Displays detailed license information for the installed edition, which typically includes the license status and the last characters of the product key. | No |
So “deactivate” in practice means /upk, optionally followed by /cpky. Microsoft describes both as licensing operations; neither is documented as touching your files, apps or settings.
Check What Kind of License You Have First
Whether removing the key helps depends on how the PC was activated. Open Start > Settings > System > Activation and read the status. Microsoft’s Activate Windows page lists these messages:
- Windows is activated: activated, usually with a product key.
- Windows is activated with a digital license: the entitlement is stored by Microsoft against this hardware.
- Windows is activated with a digital license linked to your Microsoft account: as above, and tied to your account too.
- Windows is not activated: there’s nothing to move.
Then think about where the license came from. Microsoft describes a boxed or digital copy bought from an authorized retailer as activating with a product key, while a PC that came with Windows 11 uses a key preinstalled by the manufacturer. A key you bought yourself is the case where uninstalling it before moving makes sense. Whether a particular license may be moved to another PC at all depends on its license terms, which Microsoft’s activation page doesn’t spell out, so check the terms that came with your copy before you rely on a transfer. For more background on license types, see how Windows 11 licenses and product keys work.
Save your key before you remove it. After /upk, Windows no longer holds the key, and slmgr /dlv only ever showed the last few characters. Find the full 25-character key on the email receipt, the box card or your retailer account. If you can’t find it, finding the product key with Command Prompt covers what can be recovered. On a PC that came with Windows preinstalled, check the license terms before assuming that key can move to other hardware.
Uninstall the Product Key With slmgr /upk
Make sure you’re signed in to an account with administrator rights before you begin.
- Open an elevated Command Prompt: click Start, type cmd, then choose Run as administrator and approve the prompt. (Other routes are in running Command Prompt as admin on Windows 11.)
- Type
slmgr /dlvand press Enter. Note the license status and any partial product key shown in the window that appears, so you can compare later. Click OK.

- Type
slmgr /upkand press Enter. A small message window should confirm that the key was uninstalled. Click OK.

- Optional: type
slmgr /cpkyand press Enter to clear the key from the registry too. This is cleanup, not deactivation; it’s useful when the PC is leaving your hands. - Restart the PC.
Don’t be surprised if Settings still says Windows is activated before the restart. Microsoft’s wording is that the Unlicensed state takes effect after a restart.
Confirm the Key Is Gone
- After the restart, open Command Prompt and run
slmgr /dlvagain. The product key details from before should no longer appear, or the tool may report that no product key was found. - Open Settings > System > Activation. Look for Windows is not activated.

If the page still shows a digital license, the PC also has a hardware-linked entitlement, which Microsoft says comes from an upgrade or a Microsoft Store purchase, and /upk doesn’t remove it.
Use the Key on the New PC
On the new machine, the key must match the edition installed there. Microsoft states that if your license doesn’t match the Windows edition you bought or are entitled to, Windows won’t activate, so a Windows 11 Pro key won’t activate Windows 11 Home.
In Settings: go to Settings > System > Activation, select Change product key, type the 25-character key and follow the prompts. The full walkthrough, including errors, is in activating Windows 11.
From an elevated Command Prompt:
- Run
slmgr /ipkfollowed by a space and your key in five groups of five characters separated by hyphens. Microsoft notes this silently replaces any key already installed. - Run
slmgr /atoto activate online. - Run
slmgr /dlvand check the license status and partial key.
If you’re setting up the new PC from scratch, you can skip the key during installation by choosing I don’t have a product key and enter it later. Microsoft says a PC that already has a digital license activates online automatically after installation.
Digital Licenses and Your Microsoft Account
A digital license works differently from a key you type. Microsoft lets you link it to your Microsoft account: as an administrator, open the Activation page, select Add an account, and sign in. Microsoft says the link lets you reactivate with the Activation troubleshooter after a significant hardware change, such as a new motherboard. It also says that if the original manufacturer replaced the motherboard for you, the PC should reactivate automatically.
Microsoft doesn’t describe a way to “release” a digital license from one PC so it activates another. If the new PC won’t activate with a license you believe you can move, run the Activation troubleshooter from the Activation page and follow its options, and check your license terms.
If the Old PC Is Dead or Already Gone
You can’t run /upk on a PC that won’t boot or that you no longer have. In that case, enter the key on the new PC anyway and see whether it activates; if it doesn’t, the Activation page shows an error and offers the troubleshooter. If activation still fails, you can contact Microsoft support through the Get Help app; have your proof of purchase ready. What support can do depends on your license.
Selling or Giving Away the PC
If you’re keeping the key, remove it with /upk and /cpky as above, then reset the PC with the option that removes everything, as described in wiping and reinstalling Windows 11. A reset removes your accounts and files; uninstalling the key only handles licensing. Also sign out of your Microsoft account and other services on the device before handing it over.
If the PC came with Windows 11 preinstalled and you aren’t moving its license anywhere, there’s no reason to remove the key: the buyer gets a PC that is still activated.
If Something Goes Wrong
- slmgr reports a permissions or access error: the Command Prompt isn’t elevated. Close it and reopen with Run as administrator. /dlv and /xpr work without elevation; /upk, /cpky and /ipk need it.
- You removed the key by mistake: reinstall it with
slmgr /ipkand the full key, then runslmgr /ato. Microsoft recommends restarting (or restarting the Software Protection service) after installing a key. - The new PC says the key doesn’t match: confirm the edition (Home or Pro) on the Activation page and compare it with what you bought.
- Activation fails online: open the Activation page, read the error code shown there and use the troubleshooter. The commands in activating Windows 11 from Command Prompt show how to read the status in more detail.
License and Deactivation Questions
Will Windows stop working after slmgr /upk?
Windows keeps running and slmgr doesn’t touch your files. After the restart the Activation page shows that Windows is not activated.
Can I put the same key back on the old PC later?
Yes, with slmgr /ipk or Change product key, as long as the edition matches and the key is still valid for use there under its terms.
Does slmgr /xpr tell me anything useful here?
It shows the activation expiration date. Microsoft notes it’s mainly useful for KMS clients because MAK and retail activation is perpetual, so on a home PC it normally just confirms permanent activation.
Do I need to remove the key if I’m reinstalling Windows on the same PC?
No. Microsoft says you can reinstall the same edition on the same device without a product key and it activates online after setup; if you used a key, you can enter it again during or after setup.
Once the old PC shows Windows is not activated and you have the key written down, activate the new PC and confirm its status on the Activation page.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.