Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Activate Windows: Command Line Steps

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The command to activate Windows is slmgr /ato, run from an elevated Command Prompt or PowerShell window. This tells Windows to contact Microsoft's activation servers and activate the current license. Before you run it, make sure Windows is already connected to the internet and that a product key has been installed (or the PC has a digital license). If no key is present, you will need to install one first with slmgr /ipk <product-key>. The steps below cover both cases, plus how to check activation status and what to do if the command fails.

What You'll Need

  • A Windows PC running Windows 10 or Windows 11 (the commands are the same on both).
  • An internet connection, because activation contacts Microsoft's servers.
  • A valid 25-character product key, or a digital license already linked to the device or your Microsoft account.
  • Administrator rights on the PC. The commands must be run in an elevated window.

Step-by-Step

  1. Open an elevated Command Prompt or PowerShell. Right-click the Start button and choose Terminal (Admin) on Windows 11, or Windows PowerShell (Admin) or Command Prompt (Admin) on Windows 10. If you use the search box, type cmd, right-click Command Prompt, and choose Run as administrator. Accept the User Account Control prompt. The window title should include Administrator; if it does not, close it and repeat.
  2. Check the current activation state. Type slmgr /xpr and press Enter. A dialog box will tell you whether Windows is permanently activated, in a grace period, or not activated. This gives you a baseline before you change anything.
  3. Install a product key if one is not already present. If you have a 25-character key, type slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (replace the Xs with your key) and press Enter. Wait for the confirmation dialog. If your PC already has a digital license, you can skip this step; running /ato without a key is fine when the license is tied to the hardware or your Microsoft account.
  4. Run the activation command. Type slmgr /ato and press Enter. Windows will contact the activation servers. A dialog box should appear saying the product was activated successfully. If it says the activation server determined the specified product key is invalid or that the key is blocked, see Troubleshooting below.
  5. Confirm activation. Run slmgr /xpr again, or open Settings > System > Activation (Windows 11) or Settings > Update & Security > Activation (Windows 10). The page should show Windows is activated and, for a digital license, Windows is activated with a digital license linked to your Microsoft account. Menu labels can differ slightly by Windows version and region.
  6. Restart if prompted. Some changes, especially after installing a new key, only take full effect after a restart. Save your work and reboot, then check the Activation page once more.

Common Mistakes

  • Running the command in a normal window. Without administrator rights, slmgr will return an error about needing elevation. Always use Run as administrator.
  • Typing the key with spaces or missing characters. The key must be exactly 25 characters in five groups of five. Copy it carefully; a single wrong character produces a generic invalid-key error.
  • Using a key that belongs to another edition. A Windows 10 Home key will not activate Windows 11 Pro, for example. Match the key to the edition shown in Settings > System > About.
  • Expecting /ato to work offline. The command needs a live connection to Microsoft's activation servers. A blocked firewall or a proxy can cause it to fail even when the PC otherwise has internet.
  • Reusing a key on too many PCs. Retail keys can be moved between PCs, but only one machine can use a given key at a time. Volume and OEM keys have their own rules; if the key is already in use elsewhere, activation will be refused.

Tips

  • Run slmgr /dlv to see detailed license information, including the edition, the partial product key, and the activation expiry. This is useful when you are not sure which key is installed.
  • If you are reinstalling Windows, choose I don't have a product key during setup when the PC has a digital license; Windows will activate automatically once it is online.
  • Keep the Command Prompt open after running /ato so you can read the result dialog before it closes. The dialog stays until you click OK.
  • Link your digital license to your Microsoft account in Settings > Accounts so you can reactivate after a hardware change. The exact wording varies by version.
  • Use only official Microsoft sources for keys and downloads. Avoid third-party “activators” or modified scripts; they are not supported and can expose the PC to malware.

Troubleshooting

If slmgr /ato does not activate Windows, work through these checks in order:

  1. Confirm you are online. Open a browser and load a page. If the PC cannot reach the internet, fix that first. A captive portal or a proxy can block activation even when browsing seems to work.
  2. Check the Windows activation service. Open Services from the Start menu search, find Software Protection, and confirm it is running. If it is stopped, start it and run slmgr /ato again.
  3. Re-enter the key. Run slmgr /ipk with the key again, then slmgr /ato. A single mistyped character is a common cause of failure.
  4. Run the activation troubleshooter. In Settings > System > Activation (Windows 11) or Settings > Update & Security > Activation (Windows 10), look for the troubleshooter link. It can resolve common issues such as a recent hardware change.
  5. Check the error message. Note the exact code shown in the dialog and search Microsoft's official support pages for that code. Common codes point to an invalid key, a key already in use, or a server that could not be reached.
  6. Restart and try again. A reboot clears temporary licensing states. If activation still fails, contact Microsoft support with your key and the error code; they can confirm whether the key is valid and unused.

Do not use unofficial activation tools or scripts. They are not supported, may violate the license terms, and can introduce malware. If your key is lost, check your Microsoft account order history or the packaging or email receipt from the original purchase.

Frequently Asked Questions

What is the exact command to activate Windows?

Open an elevated Command Prompt or PowerShell and run slmgr /ato. If no key is installed, first run slmgr /ipk <your-25-character-key>, then run slmgr /ato.

Does the command work on both Windows 10 and Windows 11?

Yes. The slmgr commands are the same on both versions. Only the Settings pages where you check activation status differ slightly.

Can I activate Windows without a product key?

Only if the PC already has a digital license linked to the hardware or your Microsoft account. In that case, slmgr /ato can activate Windows without you typing a key. Otherwise a valid key is required.

Why does it say the activation server could not be reached?

Usually a network problem: no internet, a proxy, a firewall blocking the activation service, or the Software Protection service being stopped. Fix the connection, start the service, and run the command again.

Will running the command delete my files or apps?

No. Activation only changes the license state of Windows. It does not touch personal files, installed programs, or settings.

How do I check whether activation succeeded?

Run slmgr /xpr, or open Settings > System > Activation on Windows 11 or Settings > Update & Security > Activation on Windows 10. The page should state that Windows is activated.