Smart Systems for Home

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

Activate Windows with Command Prompt: Step-by-Step

· 5 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

You can activate Windows from Command Prompt using the built-in slmgr script, but only if you have a valid product key or your PC is connected to a properly configured activation server. This guide covers the official, supported method for activating Windows with Command Prompt, including what to prepare, the exact commands to run, and how to fix common errors.

What You'll Need

  • A valid 25-character Windows product key (for retail or volume licenses) or a digital license linked to your Microsoft account.
  • An internet connection (for online activation) or access to your organization's Key Management Service (KMS) server if you're on a volume license.
  • Administrator rights on the PC — you'll need to open Command Prompt as administrator.
  • Windows installed and running (any edition that supports activation via slmgr, which is all standard editions).

Step-by-Step

  1. Open Command Prompt as administrator. Press the Windows key, type cmd, right-click Command Prompt, and choose Run as administrator. Approve the User Account Control prompt. (On Windows 11, you can also right-click the Start button and select Terminal (Admin) or Command Prompt (Admin).)
  2. Check your current activation status. Type slmgr /xpr and press Enter. A dialog box will tell you whether Windows is permanently activated, activated until a date, or not activated. This confirms whether you need to proceed.
  3. Install your product key (if you have one). Type slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (replace the X's with your actual 25-character key) and press Enter. You should see a message that the product key was installed successfully. If you have a digital license already linked to your hardware, you can skip this step and go to step 5.
  4. Set the KMS server (only for volume license or organization PCs). If your IT department gave you a KMS server address, type slmgr /skms your-server-address:port and press Enter. If you're activating a retail license online, skip this step.
  5. Activate Windows. Type slmgr /ato and press Enter. Windows will contact the activation server. A message will confirm successful activation or show an error code.
  6. Verify activation. Run slmgr /xpr again. It should now say Windows is permanently activated (or show the expiration date for volume licenses). You can also check Settings > System > Activation to see the status in the graphical interface.

Common Mistakes

  • Running Command Prompt without administrator rights. The slmgr commands will fail with an access-denied error. Always open as administrator.
  • Typing the product key incorrectly. Keys are 25 characters, grouped in five blocks of five. A single wrong character will cause an error. Double-check before pressing Enter.
  • Using a KMS server address that is unreachable. If you're not on a corporate network, don't set a KMS server; use online activation instead.
  • Assuming a digital license needs a key. If your PC came with Windows pre-installed, the license is often embedded in the firmware. Running slmgr /ato without a key may activate it automatically.
  • Ignoring error codes. Each slmgr error code points to a specific issue (e.g., 0xC004F074 means the KMS server is unreachable). Look up the code before retrying blindly.

Tips

  • You can run slmgr /dlv to see detailed license information, including the activation ID and remaining grace period.
  • If you're reinstalling Windows on the same hardware, activation usually happens automatically once you're online — no key needed.
  • For volume licenses, the KMS server address is often provided by your IT admin; don't guess it.
  • Keep your product key safe. Once activated, you can retrieve it later using slmgr /dli (it shows the last five characters) or third-party tools, but Microsoft doesn't store it in plain text.
  • Command Prompt must be run with elevated privileges; a standard command prompt won't work.

Troubleshooting

If activation fails, work through these checks in order:

  1. Check your internet connection. Online activation requires an active connection. Open a browser and confirm you can reach the internet.
  2. Run slmgr /ato again. Sometimes a transient network issue causes a temporary failure; retrying often works.
  3. Verify the product key. Run slmgr /ipk again with the correct key. If you get error 0xC004F050, the key is invalid or blocked.
  4. Check the error code. Common codes: 0xC004F074 (KMS server unreachable — check the address or your network), 0xC004C003 (key blocked — contact Microsoft support), 0xC004E015 (license tampering — may require phone activation).
  5. Use the Activation troubleshooter. Go to Settings > System > Activation and click Troubleshoot. This built-in tool can fix many common issues automatically.
  6. Try phone activation. If online activation fails repeatedly, run slui 4 to start the automated phone activation wizard. Follow the prompts to enter your key and receive a confirmation ID.
  7. Contact Microsoft support or your IT admin. For volume licenses, your organization's helpdesk can check the KMS server. For retail licenses, Microsoft support can help resolve key issues.

If none of these steps work, do not use unofficial activation tools or scripts — they violate the license agreement and can introduce malware. Stick to official Microsoft methods.

Frequently Asked Questions

Can I activate Windows without a product key?

Yes, if your PC has a digital license linked to your Microsoft account or embedded in the firmware (common on pre-built PCs and laptops). Running slmgr /ato while signed in with that account and connected to the internet will activate Windows automatically.

What does slmgr /ato do?

It attempts online activation using the currently installed product key or digital license. It contacts Microsoft's activation servers and, if successful, permanently activates Windows.

Is it legal to activate Windows via Command Prompt?

Yes, using slmgr with a valid, legally obtained product key is an official Microsoft method. Using cracks, key generators, or unauthorized KMS servers is illegal and violates the license terms.

Why do I get error 0xC004F074?

This error means Windows cannot reach the Key Management Service (KMS) server. It usually occurs on volume-license PCs when the KMS server address is wrong or the server is offline. Check the address with your IT admin or switch to online activation if you have a retail key.

Can I activate Windows on multiple PCs with one key?

Retail licenses are typically for one PC at a time. Volume licenses are managed by organizations and can activate multiple PCs, but only within the terms of the agreement. Transferring a retail license to a new PC may require phone activation.

How do I check if Windows is activated?

Run slmgr /xpr in Command Prompt, or go to Settings > System > Activation. Both show whether Windows is activated and, for volume licenses, the expiration date.